Try this:
open(FILE,"f:/file.txt") || print("open() failed as file did not exist.\n");
while (){
print $_;
}
Bedanta
-Original Message-
From: badrinath chitrala [mailto:[EMAIL PROTECTED]
Sent: Monday, May 08, 2006 2:46 PM
To: beginners@perl.org
Subject: print file
Hi
open F
Thanks, John for that, it works fine now...
Bedanta
-Original Message-
From: John W. Krahn [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 29, 2005 3:25 PM
To: Perl Beginners
Subject: Re: Error : Nested quantifiers before HERE mark in regex
Bedanta Bordoloi, Gurgaon wrote:
> Hi
regex
On Nov 29, 2005, at 10:22, Bedanta Bordoloi, Gurgaon wrote:
> Hi All,
>
> I'm using the following regex in my code with processes a log file
>
> $str =~ s/(^$log_entry[0]\s)//i
>
> But I'm getting the following error on running the script:
>
>
Hi All,
I'm using the following regex in my code with processes a log file
$str =~ s/(^$log_entry[0]\s)//i
But I'm getting the following error on running the script:
Nested quantifiers before HERE mark in regex m/(^img13.** << HERE **\s)/
Can the regex be written in some other
Hi Jeff,
Here's a solution u can have a look at:
open(INPUTFILE, "d:/data.log");
open(OUTPUTFILE, ">d:/output.log");
my $last_str = "INIT";
RECORD: while(){
chomp;
$str = $_;
if ($last_str ne "INIT" && length($str) != 0){
print OUTPUTFILE "$last_str $str\n"
Hello,
You can simply say
while (){
if ($_ =~ /NSTEP/){
print OUT $_;
}
}
Bedanta
-Original Message-
From: Vineet Pande [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 17, 2005 4:24 PM
To: beginners@perl.org
Subject: matching pattern & printing
Hi:
Disclaimer:
This message and any attachment(s) contained here are information that is
confidential, proprietary to HCL Technologies and its customers. Contents may
be privileged or otherwise protected by law. The information is solely intended
for the individual or the entity it is addresse
Disclaimer:
This message and any attachment(s) contained here are information that is
confidential, proprietary to HCL Technologies and its customers. Contents may
be privileged or otherwise protected by law. The information is solely intended
for the individual or the entity it is addresse
Hi,
If I've understood your problem, what you can simply try is
$string = "but";
print "Before: $string ";
$string =~ s/u/a/g;
print "After: $string\n";
You will get as output
$ Before: but After: bat
Cheers,
Bedanta
-Original Message-
From: Harold Castro [mailto:[EMAIL PROTECTED]