in reply to Re^2: Seperating individual lines of a file
in thread Seperating individual lines of a file
First, that's an interesting use of push - you could just do @DATA=<ORIGFILE>;, but I don't think that's a big deal.
Second, you'll find that you'll want to open your file for writing by using the open, FILEHANDLE, ">filename" nomenclature.
Third, as written, your code will open a file called "host1 BUNCHOFDATAINALINE". You might want to split( /pattern/, expression ) each line of the file so you can separately refer to the separate pieces of data, like ( $HOSTNAME, $SOMEDATA ).
$/ = q#(\w)# ; sub sig { print scalar reverse join ' ', @_ } + sig map { s$\$/\$/$\$2\$1$g && $_ } split( ' ', ",erckha rlPe erthnoa stJu +" );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Seperating individual lines of a file
by tgrossner (Novice) on Feb 02, 2006 at 22:24 UTC | |
by chargrill (Parson) on Feb 02, 2006 at 23:20 UTC | |
by blazar (Canon) on Feb 03, 2006 at 12:38 UTC |