Home > Archive > PERL CGI Beginners > May 2004 > Please Help ! this might be simple but not for me :(
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Please Help ! this might be simple but not for me :(
|
|
| amjoe11-3@yahoo.com 2004-05-22, 11:32 am |
| Hi All Perl Gurus !
I'm in the middle of this and i'm not able to figure out what is wrong !
I have a html file and i want to do a grep for the accourance of "<!--#include
virtual" and push every result to an array. Then get only the filepath into another
array ... but man !i'm stuck... please help
HEre is my code
--------------
$temp = "somefile.html"
@incarray = grep "<!\-\-\#include virtual" $temp;
my $count=0;
foreach my $incarr(@incarray){
my $finalinc=$incarr;
my $finalsrc=$incarr;
$finalinc =~s#<\!--\#include virtual=\"(.*)#$1#g;
$finalsrc =~s#<script src=\"(.*)#$1#g;
push(@links, "$finalinc\n");
push(@links, "$finalsrc\n");
}
------------
Whats WRONG ! :(
Thanks in Advance - Joe</textarea></font>
</td></tr>
<tr>
<td>
<input type=checkbox name="SigAtt" value="1" id="SA">Use my signature
</td>
<td align=right>
<input type=checkbox name=Format value="" onclick="setFormat()" >
Allow HTML tags [<a href="java script:Preview()">Preview</a>]
</td>
</tr>
</table>
</td>
</tr>
<tr class=frmb valign=top>
<td align=right><b>Options:</b></td>
<td>
<table border=0 cellpadding=2 cellspacing=0>
<tr><td colspan=2><input type=checkbox name="SaveCopy" value="yes" id="Save">Save a
copy in your <b>Sent Items</b> folder</td></tr>
<tr><td colspan=2><input type=checkbox name="SendMoney" value="yes"> Send money
using <b>Yahoo! PayDirect from HSBC</b>: $<input type=text name=Money value=""
size=5 onkeyup="OnMoneyChange()" onchange="OnMoneyChange()"> <small><a
href="java script:Help('http://us.rd.yahoo.com/mail_us/help/?http://help.yahoo.com/help/us/mail/...context-47.html')">More
Info</a></small></td></tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table cellpadding=4 cellspacing=0 border=0 width="100%">
<tr class=bbar bgcolor="#3f6c96">
<td nowrap>
<input type=submit name=SEND value=" Send " title="Send
Message" class=abutton
onclick="AC_PostProcess()"
>
<input type=submit name=SD value="Save as a Draft" title="Save Message in your
Drafts folder" class=fbutton >
<input type=submit name=SC value="Spell Check" title="Check your message's spelling
before sending" class=fbutton >
<input type=submit name=CAN value="Cancel" title="Cancel" class=fbutton>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table width="100%" cellpadding=0 cellspacing=0 border=0>
<tr><td class=bgd bgcolor="#9bbad6" height=4><img
src="http://us.i1.yimg.com/us.yimg.com/i/space.gif" width=2 height=3></td></tr>
</table>
<center>
<table cellpadding=4 cellspacing=0 border=0>
<tr><td>
<a href="/ym/Welcome?YY=25843">Mail</a> -
<a
href="http://us.rd.yahoo.com/mail_us/footer/ab/?http://address.yahoo.com/yab/us">Address
Book</a>
- <a
href="http://us.rd.yahoo.com/mail_us/footer/cal/?http://calendar.yahoo.com">Calendar</a>
- <a
href="http://us.rd.yahoo.com/mail_us/footer/note/?http://notepad.yahoo.com">Notepad</a>
</td></tr>
</table>
</center>
<br>
<table cellpadding=0 cellspacing=0 border=0 width="100%"><tr><td
bgcolor=#a0b8c8><table cellpadding=1 cellspacing=1 border=0 width="100%"><tr
valign=top bgcolor=#ffffff><td align=center><font face="arial" size=-2><a
href="http://us.rd.yahoo.com/footer/*http://address.yahoo.com/">Address Book</a>
· <a
href="http://us.rd.yahoo.com/footer/*http://auctions.yahoo.com/">Auctions</a> ·
<a href="http://us.rd.yahoo.com/footer/*http://autos.yahoo.com/">Autos</a> · <a
href="http://us.rd.yahoo.com/footer/*http://briefcase.yahoo.com/">Briefcase</a>
· <a
href="http://us.rd.yahoo.com/footer/*http://calendar.yahoo.com/">Calendar</a> ·
<a href="http://us.rd.yahoo.com/footer/*http://chat.yahoo.com/">Chat</a> · <a
href="http://us.rd.yahoo.com/footer/*http://classifieds.yahoo.com/">Classifieds</a>
· <a
href="http://us.rd.yahoo.com/footer/*http://finance.yahoo.com/">Finance</a> ·
<a href="http://us.rd.yahoo.com/footer/*http://games.yahoo.com/">Games</a> · <a
href="http://us.rd.yahoo.com/footer/*http://geocities.yahoo.com/">Geocities</a>
· <a
href="http://us.rd.yahoo.com/footer/*http://greetings.yahoo.com/">Greetings</a>
· <a href="http://us.rd.yahoo.com/footer/*http://groups.yahoo.com/">Groups</a>
· <a href="http://us.rd.yahoo.com/footer/*http://health.yahoo.com/">Health</a>
· <a
href="http://us.rd.yahoo.com/footer/*http://astrology.yahoo.com/yastro/">Horoscopes</a>
· <a
href="http://us.rd.yahoo.com/footer/*http://hotjobs.yahoo.com/">HotJobs</a> ·
<a href="http://us.rd.yahoo.com/footer/*http://www.yahooligans.com/">Kids</a> ·
<a href="http://us.rd.yahoo.com/footer/*http://mail.yahoo.com/">Mail</a> · <a
href="http://us.rd.yahoo.com/footer/*http://maps.yahoo.com/">Maps</a> · <a
href="http://us.rd.yahoo.com/footer/*http://members.yahoo.com/">Member Directory</a>
· <a
href="http://us.rd.yahoo.com/footer/*http://messenger.yahoo.com/">Messenger</a>
· <a href="http://us.rd.yahoo.com/footer/*http://mobile.yahoo.com/">Mobile</a>
· <a href="http://us.rd.yahoo.com/footer/*http://movies.yahoo.com/">Movies</a>
· <a href="http://us.rd.yahoo.com/footer/*http://launch.yahoo.com/">Music</a>
· <a
href="http://us.rd.yahoo.com/footer/*http://my.yahoo.com/">My Yahoo!</a> ·
<a href="http://us.rd.yahoo.com/footer/*http://news.yahoo.com/">News</a> · <a
href="http://us.rd.yahoo.com/footer/*http://paydirect.yahoo.com/">PayDirect</a>
· <a
href="http://us.rd.yahoo.com/footer/*http://personals.yahoo.com/">Personals</a>
· <a href="http://us.rd.yahoo.com/footer/*http://pets.yahoo.com/">Pets</a>
· <a href="http://us.rd.yahoo.com/footer/*http://photos.yahoo.com/">Photos</a>
· <a
href="http://us.rd.yahoo.com/footer/*http://shopping.yahoo.com/">Shopping</a> ·
<a href="http://us.rd.yahoo.com/footer/*http://sports.yahoo.com/">Sports</a> ·
<a href="http://us.rd.yahoo.com/footer/*http://tv.yahoo.com/">TV</a> · <a
href="http://us.rd.yahoo.com/footer/*http://travel.yahoo.com/">Travel</a> · <a
href="http://us.rd.yahoo.com/footer/*http://weather.yahoo.com/">Weather</a> ·
<a href="http://us.rd.yahoo.com/footer/*http://yp.yahoo.com/">Yellow Pages</a>
· <a
href="http://us.rd.yahoo.com/footer/*http://docs.yahoo.com/docs/family/more.html">more...</a></font></td></tr></table></td></tr></table>
<script language=javascript> var ADFadids =
" 1522466,1522468,1453288,1453290,2026337,
1544483,1052425"; function ADFlaunch() {var
w; var
l="http://rd.yahoo.com/SIG=129i3of7r/M=224039.2020109.3495275.1958505/D=mail/S=150500005:FOOT2/EXP=1083890665/A=1052425/R=0/id=adfeedback/SIG=12eq41352/*http://promo.yahoo.com/adfeedback/?...rty=mail&adids="+ADFadids;
w=window.open(l,"AdFeedbackWin"," toolbar=no,scrollbars=yes,resizable,loca
tion=no,height=400,width=640");
}</script><center><small><br>Copyright © 1994-2004 <a
href="http://rd.yahoo.com/SIG=129i3of7r/M=224039.2020109.3495275.1958505/D=mail/S=150500005:FOOT2/EXP=1083890665/A=1052425/R=1/mail_us/tos/SIG=10mgpruen/*http://www.yahoo.com"
target="_blank">Yahoo!</a> Inc. All rights reserved. <a
href="http://rd.yahoo.com/SIG=129i3of7r/M=224039.2020109.3495275.1958505/D=mail/S=150500005:FOOT2/EXP=1083890665/A=1052425/R=2/SIG=1136qnvkg/*http://docs.yahoo.com/info/terms/">Terms
of Service</a> - <a
href=http://rd.yahoo.com/SIG=129i3of7r/M=224039.2020109.3495275.1958505/D=mail/S=150500005:FOOT2/EXP=1083890665/A=1052425/R=3/SIG=11lp7krrc/*http://docs.yahoo.com/info/copyright/copyright.html>Copyright
Policy</a> - <a
href="http://rd.yahoo.com/SIG=129i3of7r/M=224039.2020109.3495275.1958505/D=mail/S=150500005:FOOT2/EXP=1083890665/A=1052425/R=4/SIG=11he80eif/*http://docs.yahoo.com/info/guidelines/mail.html">Guidelines</a>
- <a href="java script:ADFlaunch()">Ad Feedback</a><br>NOTICE: We collect personal
information on this site.<br>To learn more about how we use your information, see
our <a
href="http://rd.yahoo.com/SIG=129i3of7r/M=224039.2020109.3495275.1958505/D=mail/S=150500005:FOOT2/EXP=1083890665/A=1052425/R=5/SIG=11b5p6lhe/*http://privacy.yahoo.com/privacy/us/mail/">Privacy
Policy</a></small></center><script>
var ypim_RD_URL = "http://us.rd.yahoo.com/mail_us";
var ypim_MA_Farm_URL = "http://us.f142.mail.yahoo.com";
var ypim_AB_URL = "http://address.yahoo.com/yab/us";
var ypim_CA_URL = "http://calendar.yahoo.com";
var ypim_NP_URL = "http://notepad.yahoo.com";
var ypim_MA_YY = "939069";
var ypim_IMG = "http://us.i1.yimg.com/us.yimg.com/i/us/pim";
var ypim_Loc = "us";
var ypim_MA_Help = "http://help.yahoo.com/help/us/mail/";
var ypim_IsCalendarView = false;
var ypim_IsNotepadView = false;
var ypim_i18n_CheckMail = "Check Mail";
var ypim_i18n_Compose = "Compose";
var ypim_i18n_Folders = "Folders";
var ypim_i18n_Search = "Search";
var ypim_i18n_Options = "Options";
var ypim_i18n_Help = "Help";
var ypim_i18n_AddContact = "Add Contact";
var ypim_i18n_AddCategory = "Add Category";
var ypim_i18n_AddList = "Add List";
var ypim_i18n_ViewContacts = "View Contacts";
var ypim_i18n_ViewLists = "View Lists";
var ypim_i18n_Quickbuilder = "Quickbuilder";
var ypim_i18n_ImportContacts = "Import Contacts";
var ypim_i18n_Synchronize = "Synchronize";
var ypim_i18n_AddressesOptions = "Addresses Options";
var ypim_i18n_AddressesHelp = "Addresses Help";
var ypim_i18n_AddEvent = "Add Event";
var ypim_i18n_AddTask = "Add Task";
var ypim_i18n_AddBirthday = "Add Birthday";
var ypim_i18n_Day = "Day";
var ypim_i18n_W = "W ";
var ypim_i18n_Month = "Month";
var ypim_i18n_Year = "Year";
var ypim_i18n_EventList = "Event List";
var ypim_i18n_Reminders = "Reminders";
var ypim_i18n_Tasks = "Tasks";
var ypim_i18n_Sharing = "Sharing";
var ypim_i18n_Synchronize = "Synchronize";
var ypim_i18n_CalendarOptions = "Calendar Options";
var ypim_i18n_CalendarHelp = "Calendar Help";
var ypim_i18n_AddNote = "Add Note";
var ypim_i18n_AddFolder = "Add Folder";
var ypim_i18n_ViewNotes = "View Notes";
var ypim_i18n_NotepadOptions = "Notepad Options";
var ypim_i18n_NotepadHelp = "Notepad Help";
</script>
<script src="/lib_web/pulldowns.js"></script>
<div id="mail">
</div>
<div id="addr">
</div>
<div id="cal">
</div>
<div id="note" class=menubg>
</div>
<iframe name="asynch" width=0 height=0></iframe>
</form>
<ELEMENT STYLE="behavior:url('#default#clientCaps')" ID="ClientCaps">
</body>
</html>
<!-- v3.5.13.4 1083040144 -->
<!-- 0.31224 -->
<!-- web14205.mail.yahoo.com compressed/chunked Wed May 5 17:44:25 PDT 2004 -->
| |
| William McKee 2004-05-22, 11:32 am |
| On Wed, May 05, 2004 at 05:44:42PM -0700, amjoe11-3@yahoo.com wrote:
> I have a html file and i want to do a grep for the accourance of "<!--#include
> virtual" and push every result to an array. Then get only the filepath into another
> array ... but man !i'm stuck... please help
Hi amjoe11,
You are not opening the file for reading. Your syntax is incorrect.
Please read `perldoc perlopentut` for a tutorial on how to open and read
files in Perl.
BTW, you may have already had your question answered in another group
which I'm not subscribed to. It's generally considered bad netiquette to
cross-post non-announcement messages to multiple newsgroups. Try one
then move to the next if you don't get a satisfactory answer.
Good luck,
William
--
Knowmad Services Inc.
http://www.knowmad.com
|
|
|
|
|