Page is a not externally linkable
- Code, Content, and Presentation
-- Perl Server Side CGI Scripting
---- Grab source code from any supplied URL


skube - 11:36 pm on Dec 3, 2003 (gmt 0)


But now I have another problem, I have the source of the URL stored in the $source. However, I wish to convert each source line into an array @source, to do further manipulations.

Usually, one would open a file and assign each line using <> as below:

open(DAT, $data_file) ¦¦ die("Could not open file!");
@raw_data=<DAT>;
close(DAT);

But for my case, I don't have a file which I'm opening, just a very long variable $source. So, I want to do something like:

@source = <$source>

But obviously, that is incorrect syntax.


Thread source:: http://www.webmasterworld.com/perl/3354.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com