Re: Stopping variable interpolation/evaluation

2009-03-02 Thread pushkar . naik
> > 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

Re: Stopping variable interpolation/evaluation

2009-03-01 Thread Gunnar Hjalmarsson
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

Re: Stopping variable interpolation/evaluation

2009-03-01 Thread Octavian Râsnita
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

Stopping variable interpolation/evaluation

2009-03-01 Thread pushkar . naik
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

Re: What is Variable Interpolation [was: Re: Help Required on the Script]

2006-04-07 Thread D. Bolliger
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

Re: What is Variable Interpolation [was: Re: Help Required on the Script]

2006-04-06 Thread John W. Krahn
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

What is Variable Interpolation [was: Re: Help Required on the Script]

2006-04-06 Thread D. Bolliger
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

Re: Help with Hash values and variable interpolation

2002-11-08 Thread badchoice
> 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.

Re: Help with Hash values and variable interpolation

2002-11-04 Thread John W. Krahn
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

RE: Help with Hash values and variable interpolation

2002-11-04 Thread Scott, Joshua
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

Help with Hash values and variable interpolation

2002-11-04 Thread Scott, Joshua
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

Re: variable interpolation

2002-04-19 Thread bernabe diaz
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:

RE: variable interpolation

2002-04-19 Thread Bob Showalter
> -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

RE: variable interpolation

2002-04-19 Thread Hanson, Robert
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

variable interpolation

2002-04-19 Thread bernabe diaz
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

Re: variable interpolation

2002-04-19 Thread bob ackerman
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

variable interpolation

2002-04-19 Thread bernabe diaz
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

Re: Variable Interpolation

2002-04-10 Thread Jenda Krynicky
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 > > $

Variable Interpolation

2002-04-10 Thread DBuitendag
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

Re: Variable interpolation?

2002-01-07 Thread Mad B . Jones
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,

Re: Variable interpolation?

2002-01-06 Thread Jeff 'japhy' Pinyan
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

Variable interpolation?

2002-01-06 Thread Mad B . Jones
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

Re: Left side variable interpolation during associative array assignment?

2001-12-31 Thread Peter Cornelius
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

RE: Left side variable interpolation during associative array assignment?

2001-12-31 Thread Hanson, Robert
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

Left side variable interpolation during associative arrayassignment?

2001-12-31 Thread Andrew Koebrick
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

FW: Variable interpolation in a format - Disregard

2001-09-13 Thread Kim Green
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

Variable interpolation in a format

2001-09-13 Thread Kim Green
Below is my format: format FILE_TOP = New Customers Since Customer Name Creation DateActivation Date . format

Re: Variable interpolation in 'use lib'?

2001-07-15 Thread Jos I. Boumans
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

Re: Variable interpolation in 'use lib'?

2001-07-14 Thread Ted Behling
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

Re: Variable interpolation in 'use lib'?

2001-07-14 Thread Jeff 'japhy' Pinyan
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

Re: Variable interpolation in 'use lib'?

2001-07-14 Thread Ted Behling
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

Re: Variable interpolation in 'use lib'?

2001-07-14 Thread Jeff 'japhy' Pinyan
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

Variable interpolation in 'use lib'?

2001-07-14 Thread Ted Behling
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