Amichai Teumim wrote:
Thank you John
Why do I need
use warnings;
use strict;
It works without them:
with them i get:
Global symbol "@list" requires explicit package name at ./obj14-2.pl
line 7.
Global symbol "$item" requires explicit package name at ./obj14-2.pl line
10.
Global symbol "@li
Hi,
Hope you can find your solution from the following two approaches
Approach I
#!/usr/bin/perl
while (<*>) {
if ($_ =~ /note/){
open(FH, "$_");
@fcontent = ;
print @fcontent;
close(FH);
}
}
APPROACH II
opendir(CURRENT,".");
@list = readdir(CURRENT);
clos
Hi,
Hope you can find your solution from the following two approaches
Approach I
#!/usr/bin/perl
while (<*>) {
if ($_ =~ /note/){
open(FH, "$_");
@fcontent = ;
print @fcontent;
close(FH);
}
}
APPROACH II
opendir(CURRENT,".");
@list = readdir(CURRENT);
clos
Hi,
Hope you can find your solution from the following two approaches
Approach I
#!/usr/bin/perl
while (<*>) {
if ($_ =~ /note/){
open(FH, "$_");
@fcontent = ;
print @fcontent;
close(FH);
}
}
APPROACH II
opendir(CURRENT,".");
@list = readdir(CURRENT);
clos
Amichai Teumim wrote:
I'm trying to do the following:
I want to search for a specific file/s in my current dir and when it finds
it, print its contents. So I did the following:
#!/usr/bin/perl
The next two lines in your program should be:
use warnings;
use strict;
opendir(CURRENT,".");
Amichai Teumim 写道:
I'm trying to do the following:
I want to search for a specific file/s in my current dir and when it finds
it, print its contents. So I did the following:
#!/usr/bin/perl
please add 'use strict' and 'use warnings' at the the begin of a script.
opendir(CURRENT,".");
opend
I'm trying to do the following:
I want to search for a specific file/s in my current dir and when it finds
it, print its contents. So I did the following:
#!/usr/bin/perl
opendir(CURRENT,".");
@list = readdir(CURRENT);
closedir(CURRENT);
foreach $item (@list){
if($item =~ /notes/){
open(FI