>but also one of perls weakenesses
Sir,yes,i also term it as a weakness. because it is hiding the fact!
anyway,
so you mean there are some functions which uses this $_ variable.
but in your previous example which you posted (while loop code) there is no function nor operator is no it ...
Sir, This is a very difficult statement to understand.
i got more confused when i read the following tutorial
The $_ special variable
We could use a conditional as
if ($sentence =~ /under/)
{
print "We're talking about rugby\n";
}
which would print out a message if we had either of...
<INFO> reads a record from the file and stores that line in $_ automatically.
OK . good.
is it exclusive for only for Files ?
had it not been a file , but a simple array which contanis some data, will the same occured ?
in fact, i am worried about in which place this works and in which...
many thanks sir,
can i ask one more very simplest question ?
you made a comment...
# Read each line from file to $_ in turn
but where did you assign the line to $_ . you did not assign it.
how does it get the value ?
i am feeling uncomfortable with this.
will you please tell me whats...
i have one more smallest question.
as i am learning perl , can i use perl in windows machine ?
right now, i am writing codes in linux machine.
is perl only exclusive for linux machine ?
does it work in windows 2000, windows XP machine ?
this works fine. you have explained very nicely. thanks
i also examined
with
print $_; // just prints variable
print "\n"; // just prints the newline
and also
print $_."\n"; // i read this the rule concatecation of sting
and i am comfortable with these two syntax.
i was not feeling...
in this context i just have a small question
you gave me his code in my previous post
code was like below
while(<>) {
# $_ contains each line from the file, one at a time
# process the line here.
}
will you please how do you read line by lne with a while loop ?
i am reading with a...
>What did you expect your program to output?
i want the program should not print the output at all. you know C,C++,JAVA all programs behaves dont show output once there is some compile erorr.
this language is somewhat exceptional
excellent !! and excellent !
this error is really self-explanarotory. any body can understand this error message and find out the place where this error has occured.
so, i have decided to use -w, use strict, use diagonstics and ALL MY VARIABLES would be prefixed by the my keyword.
its...
ohh , forgot to post the code.
i did intentonally wrong code to test -w and use strict
here is the code
#!/usr/local/bin/perl -w
use strict;
#@food = ("apples", "pears", "eels");
#$l=push(@food, "eggs", "lard");
#($a, $b) = @food;
#$f ="@food";
#print $b;
#($a, $b) = ($c, $d);
$d='009'...
but they are suppresingg errors.
using strict and -w i got error
Global symbol "$d" requires explicit package name at test line 9.
Global symbol "$e" requires explicit package name at test line 10.
Global symbol "$f" requires explicit package name at test line 11.
Global symbol "$d"...
$file = '/etc/passwd'; # Name the file
open(INFO, $file); # Open the file
i made the bold statements . i just could not understand those statements. will you plese tell me in a simpler way ?
what those statements wants to say ? please rovide an easy example.
thanks for your time.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.