Hi Everyone,
Im trying to read in a file, split it using variables like this ( ($short,$long,$sd)= split (/\|/,$line); )
and i need to push all the $short into an array which then i will have to print.
How do we push a variable into an array?
My script:
#!/usr/bin/perl -w
open (HANDLE, '/usr/local/zedit/termcap') or die $!;
@array = ();
while ($line = <HANDLE>)
{
next if $line =~ /^#/;
next if $line =~ /^ /;
next if $line =~ /^\t/;
next if $line =~ /^$/;
next if $line =~ /^ /;
($short,$long,$sd)= split (/\|/,$line);
push (@array,$short[0]);
}
close HANDLE;