The following has some error in regular expression line, could you please rectify. That is how my program should be. Here, what I am trying to do is assigning the values of two columns from the text file to a1 and a2, and finally I want to print it on the screen. The following is the code. You were really helpful and understood my state of knowledge. Thanx.
#!/usr/bin/perl #use warnings; open (GRAPH, "11.txt") || die "Can't open 11.txt: $!\n"; while ($line=<GRAPH>) { if $line = /(\s+)(\s+)/$1, $2; { a1 = push(@a1, $1); a2 = push(@a2, $2); next; } } print @a1, @a2; close GRAPH;
Janitored by Arunbear - added code tags, as per Monastery guidelines
In reply to Re^4: Assigning values. Simple and Nasty one.
by Anonymous Monk
in thread Assigning values. Simple and Nasty one.
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |