>
> Use print(), not printf().
>
> --
> Gunnar Hjalmarsson
> Email:http://www.gunnar.cc/cgi-bin/contact.pl- Hide quoted text -
>
> - Show quoted text -
Thanx Gunnar and Octavian, print() and chomp() together did the job
just fine.
~Pushkar
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.o
pushkar.n...@gmail.com wrote:
Hi, I have a line read in perl from a file that itself is a source
code for languages like c/sv etc. The variable containing this line
contains special characters like %d. When i print this line to another
file, the %d is evaluated and a 0 is getting printed. How do
From:
Hi, I have a line read in perl from a file that itself is a source
code for languages like c/sv etc. The variable containing this line
contains special characters like %d. When i print this line to another
file, the %d is evaluated and a 0 is getting printed. How do i
overcome this and te
Hi, I have a line read in perl from a file that itself is a source
code for languages like c/sv etc. The variable containing this line
contains special characters like %d. When i print this line to another
file, the %d is evaluated and a 0 is getting printed. How do i
overcome this and tell perl t
John W. Krahn am Freitag, 7. April 2006 01.09:
> D. Bolliger wrote:
> > btw, @04 is not a valid (array) variable name; they must not start with a
> > digit, as not keyword/builtin does.
>
> $ perl -Mwarnings -Mstrict -le' our @04 = 10 .. 14; print "@04"'
> 10 11 12 13 14
>
> You are probably thinki
D. Bolliger wrote:
>
> btw, @04 is not a valid (array) variable name; they must not start with a
> digit, as not keyword/builtin does.
$ perl -Mwarnings -Mstrict -le' our @04 = 10 .. 14; print "@04"'
10 11 12 13 14
You are probably thinking scalars and/or lexicals.
John
--
use Perl;
program
Mazhar am Donnerstag, 6. April 2006 11.48:
> thanks Raymond for the help it works,
> and what do u mean by variable interpolation
Hello Mazhar
It will help you a lot to know and use the documentation system of perl.
You can get an overview by typing (on the command line):
perldoc perl
> 112.58.26.32.32770 > 192.35.51.30.53: 64596[|domain] (DF)
> 112.58.26.32.32770 > 192.100.59.110.53: 24685 [1au][|domain] (DF)
> 112.58.26.4.2506 > 216.148.227.69.80: . ack 3280436924 win 2920 (DF)
> 112.58.26.4.2506 > 216.148.227.69.80: . ack 1759 win 1162 (DF)
> 112.58.26.4.2498 > 66.207.130.
Joshua Scott wrote:
>
> Hello all,
Hello,
> I've got a file which contains ports and hostnames. I'd like to count the
> number of instances that each item occurs in my file. I'm having a
> difficult time with this.
>
> This is my script: Basically I'm splitting the first line a few times to
oshua [mailto:Joshua.Scott@;Jacobs.com]
Sent: Monday, November 04, 2002 5:42 PM
To: '[EMAIL PROTECTED]'
Subject: Help with Hash values and variable interpolation
Hello all,
I've got a file which contains ports and hostnames. I'd like to count the
number of instances that ea
Hello all,
I've got a file which contains ports and hostnames. I'd like to count the
number of instances that each item occurs in my file. I'm having a
difficult time with this.
This is my script: Basically I'm splitting the first line a few times to
get the data I need. What am I doing wro
gt;execute( CGI->param('NAME') );
>
>Did you also print out the variable to prove that it does indeed contain
>some data? Do you also have the RaiseError attribute turned on to die if
>there are any SQL errors?
>
>Rob
>
>
>-Original Message-
>From:
> -Original Message-
> From: bernabe diaz [mailto:[EMAIL PROTECTED]]
> Sent: Friday, April 19, 2002 10:18 AM
> To: [EMAIL PROTECTED]
> Subject: variable interpolation
>
>
> Hi everyone,
> could somebody help me with the following problem:
> i have a
t it does indeed contain
some data? Do you also have the RaiseError attribute turned on to die if
there are any SQL errors?
Rob
-Original Message-
From: bernabe diaz [mailto:[EMAIL PROTECTED]]
Subject: variable interpolation
Thanks for help, but
I tried that way too, and it does not wor
Thanks for help, but
I tried that way too, and it does not work.
BD
bob ackerman wrote:
>
> On Friday, April 19, 2002, at 07:18 AM, bernabe diaz wrote:
>
>> Hi everyone,
>> could somebody help me with the following problem:
>> i have a code something like that
>> my $variable = CGI->param('NAM
On Friday, April 19, 2002, at 07:18 AM, bernabe diaz wrote:
> Hi everyone,
> could somebody help me with the following problem:
> i have a code something like that
> my $variable = CGI->param('NAME');
> #making connection to database
> .
> my $variable_ =$dbh->q
Hi everyone,
could somebody help me with the following problem:
i have a code something like that
my $variable = CGI->param('NAME');
#making connection to database
.
my $variable_ =$dbh->quote($variable);
.
$sth = ->$dbh->prepare(" SELECT something FROM s
From: [EMAIL PROTECTED]
> Can you please help.
>
> When does Interpolation occur at Compile Time , Run Time or Both. So
> far I know on both, then why does the following not work. ( how can I
> get it to work ?)
>
> $scripts = 'cd $acu_home/bin \n nohup ${srv}_ss $srv.ini >
> $
Hi .
Can you please help.
When does Interpolation occur at Compile Time , Run Time or Both.
So far I know on both, then why does the following not work. ( how can I get it
to work ?)
$scripts = 'cd $acu_home/bin \n nohup ${srv}_ss $srv.ini >
$acu_home/bin/$srv.out&';
$acu_home = "/luke/u01/ap
06/01/02 17:20:37, Jeff 'japhy' Pinyan <[EMAIL PROTECTED]> a écrit:
>The contents of @string are raw text. You'll need to expand the variables
>in it manually:
>
> perldoc -q 'expand variables'
>
>That FAQ will tell you what to do.
Thanks, Jeff, for taking the time to answer.
My problem was,
On Jan 6, Mad B.Jones said:
>$name="Dave";
>$in="textfile.txt";
>open(INFILE, "<$in");
>@string=;
>$string="$string[0]";
The contents of @string are raw text. You'll need to expand the variables
in it manually:
perldoc -q 'expand variables'
That FAQ will tell you what to
Hi everyone. A little thing I fail to understand...
This of course works:
$name="Dave";
$string="Hello $name";
print $string;
outputting:
Hello Dave
Why, then, does it not work when I get the string "Hello $name" out of a file?
$name="Dave";
$in="textfile.txt";
open(I
Before I point to the problem here, let me point out that you are trying
to use symbolic references which will severely decrease the readability
of your code.
I personally believe that symbolic references are one of the many forms
of evil perl which, while appearing elegant, merely lure you
hat
they can't be done.
Rob
-Original Message-
From: Andrew Koebrick [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 31, 2001 4:02 PM
To: [EMAIL PROTECTED]
Subject: Left side variable interpolation during associative array
assignment?
I am trying to build up associative arrays us
I am trying to build up associative arrays using a looping draw from a database. I
would like to end up with one or more arrays(depending on number of elements in the
@Dataset) named %sub0, %sub1, %sub2... and so on. I need to keep these arrays around
for latter manipulation.
What I have now
never mind.
> -Original Message-
> From: Kim Green
> Sent: Thursday, September 13, 2001 9:11 AM
> To: '[EMAIL PROTECTED]'
> Subject: Variable interpolation in a format
>
> Below is my format:
>
> for
Below is my format:
format FILE_TOP =
New Customers Since
Customer Name Creation DateActivation Date
.
format
try mjd's article:
http://perl.plover.com/FAQs/Namespaces.html
hth,
Jos Boumans
> Whoo-hoo! Thanks again for a lightning-quick and highly useful solution.
>
> Perhaps I should re-read what Programming Perl has to say about variable
> scoping. Any other recommended reading?
--
To unsubscr
Whoo-hoo! Thanks again for a lightning-quick and highly useful solution.
Perhaps I should re-read what Programming Perl has to say about variable
scoping. Any other recommended reading?
At 01:41 AM 7/15/01 -0400, Jeff 'japhy' Pinyan wrote:
>On Jul 15, Ted Behling said:
>
>>Okay, that worked gr
On Jul 15, Ted Behling said:
>Okay, that worked great until I added 'use strict vars'. Code now reads:
Put a my ($LIB_LOC, $DEV_OR_PROD) outside (and before) the BEGIN block.
>BEGIN {
> $DEV_OR_PROD = 'dev';
> $LIB_LOC = "path/" . $DEV_OR_PROD . "/lib";
>}
>use strict vars;
>use lib "/foo/$L
Okay, that worked great until I added 'use strict vars'. Code now reads:
BEGIN {
$DEV_OR_PROD = 'dev';
$LIB_LOC = "path/" . $DEV_OR_PROD . "/lib";
}
use strict vars;
use lib "/foo/$LIB_LOC";
require 'file-to-include.pl';
print $LIB_LOC;
And returns:
Variable "$LIB_LOC" is no
On Jul 15, Ted Behling said:
>$DEV_OR_PROD = 'dev';
>$LIB_LOC = "path/" . $DEV_OR_PROD . "/lib";
>print $LIB_LOC . "\n";
>require 'file-to-include.pl';
Those four happen at RUN-TIME.
>use lib "/foo/$LIB_LOC/bar";
That one happens at COMPILE-TIME, before $LIB_LOC has a chance to be
defined. Pe
Hi all,
I'm trying to include a different file in a program depending on whether
it's in a development or production environment, but the 'use lib'
parameter doesn't include the value of the variable I want it to
interpolate. I'm running the following simplified script:
#!/usr/bin/perl
$DE
33 matches
Mail list logo