![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| perl issue .. | zedex | Shell Programming and Scripting | 3 | 09-13-2008 11:22 PM |
| issue with if loop in perl | amitrajvarma | Shell Programming and Scripting | 4 | 01-09-2008 12:02 AM |
| perl problem - another 'die' issue. | mjays | Shell Programming and Scripting | 4 | 08-15-2007 08:36 AM |
| perl help with pipes and file handles (simple issue) | the_learner | Shell Programming and Scripting | 1 | 05-06-2007 05:34 AM |
| Perl problem (compiling issue) | 01000101 | Shell Programming and Scripting | 3 | 05-24-2006 10:15 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Perl Script Issue - Please Help * Thanks!!!
Please help me with my script please. I am trying to do the following:
1. Read files for the current directory 2. Open and read from nbe files files only 3. Read only the lines with the results pattern 4. Split the line and print 3rd field Please indicate what line I need to modify. Thanks a bunch. 1 #!/usr/bin/perl -w 2 use strict; 3 use warnings; 4 5 6 # Open the current directory 7 my $directory = '.'; 8 9 # Read from the current directory 10 opendir (DIR, $directory) or die "Folder not found: $1"; 11 12 13 while (my $file = readdir(DIR)) { 14 15 if (my $File =~/\.nbe$/){ 16 17 open (File, my $File) or die "Could not open NBE file:"; 18 19 while (my $line = <FILE> ) 20 21 if ($line =~/results/) 22 23 our @$values = split (/\|/, $line); 24 25 print my $values[3]; 26 } 27 28 } 29 30 close(DIR); Error Message: syntax error at ./perlnbe_v2.pl line 30, near ") if" syntax error at ./perlnbe_v2.pl line 34, near "$values[" Execution of ./perlnbe_v2.pl aborted due to compilation errors. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|