RE: How to set environment variable

2007-09-27 Thread Siva Prasad
Hi Vikram, You are not able to access the env variable coz it is not set as you have wished. Do like the following. Set environment variable using export. export HAI=hai and print the from your perl script. The above command sets the environment variable in your system EVN variables and you c

Re: Re: How to set environment variable

2007-09-27 Thread Jeff Pang
28 Sep 2007 03:45:54 -, vikram vikram vikram <[EMAIL PROTECTED]>: > > > > Hi All, > > Yes i tried by copying the file to .env and executed the .env. > > But still the environment variable is not set. Please suggest some > solution for setting the environment variable. May be some

Re: Bundle::CPAN install error

2007-09-27 Thread Bobby
Hi, It was suggested that I look over the test script. However this is clear to me. Can anyone say what is wrong from looking here or maybe can direct me where to look for more? (I'm not a Perl programmer.) I get the idea that maybe it's checking what the version number is when getting stuck i

cpan command line

2007-09-27 Thread Bobby
Hi, What is the command to tell cpan to accept the default/suggested values? -- Bobby -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Regular expression over multiple lines issues

2007-09-27 Thread John W. Krahn
[EMAIL PROTECTED] wrote: Hello, Hello, I'm having a problem with a regular expression in some code that I inherited. I'm reading from a file and looking for certain parameters (mrn, enc, date, report_subtitle). The file looks like this: %%start %mrn%02333699 %fac%A %gpi% %enc%972014 %d

Re: Regular expression over multiple lines issues

2007-09-27 Thread Gunnar Hjalmarsson
[EMAIL PROTECTED] wrote: My problem is that the regular expression is only displaying the first item (mrn) but it won't display the others (enc, date, report_subtitle) My code is on the following line #!/usr/bin/perl #open(FILE, "3688001.ps"); open(FILE, "1234567.txt"); while ($buf = ) { Si

Re: Open File - Read Only

2007-09-27 Thread Tom Phoenix
On 9/27/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I am failing on opens now because the file is read only. What is the way > to open a file read only. Normally, it's done in the exact same way that you open any file that you don't explicitly intend to write to. What are you trying that's

Regular expression over multiple lines issues

2007-09-27 Thread [EMAIL PROTECTED]
Hello, I'm having a problem with a regular expression in some code that I inherited. I'm reading from a file and looking for certain parameters (mrn, enc, date, report_subtitle). The file looks like this: %%start %mrn%02333699 %fac%A %gpi% %enc%972014 %date%07/07/2007^14:29 %report_type%ami

Open File - Read Only

2007-09-27 Thread andrewmchorney
Hello I appreciate the response to the last question. I have scripts that I have opened files and they work. However, I am failing on opens now because the file is read only. What is the way to open a file read only. Andrew -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,

Re: Strange debugging question...

2007-09-27 Thread [EMAIL PROTECTED]
On Sep 27, 6:11 pm, [EMAIL PROTECTED] (Zachary Shay) wrote: > Is there any way to get the name of a variable by knowing its memory > address? Not in general in a reasonable time. Anyhow, how would you know the address of a variable in Perl? What do you mean by "the name"? An SV in Perl can have

Re: encoding problem?

2007-09-27 Thread [EMAIL PROTECTED]
On Sep 27, 12:27 pm, [EMAIL PROTECTED] wrote: > I am trying to use perl on the command line to process text files in > various ways, one of which is to decode html entities. As far as I can > see, the following line should work > > perl -MHTML::Entities -p -e 'decode_entities($_)' > >output.txt >

Re: $File::Find and no_chdir

2007-09-27 Thread schms
On 27 Sep., 15:01, [EMAIL PROTECTED] (Paul Lalli) wrote: > On Sep 27, 6:00 am, [EMAIL PROTECTED] (Schms) wrote: > > > I have a UNIX directory $DIR which contains a lot of files and > > subdirecotires. Now, I would > > > like to list all files and subdirectories in $DIR only. That means, > > $File:

Re: Bundle::CPAN install error

2007-09-27 Thread Bobby
On Thursday 27 September 2007 19:41:53 Tom Phoenix wrote: > On 9/27/07, Bobby <[EMAIL PROTECTED]> wrote: > > t/03pkgsok 1/11 > > > > (Here I pressed Ctrl-C after a few hours (I went to bed) of sitting on > > test 1/11.) > > It sounds as if the script gets stuck in an infinite loop. Have

Re: Bundle::CPAN install error

2007-09-27 Thread Tom Phoenix
On 9/27/07, Bobby <[EMAIL PROTECTED]> wrote: > t/03pkgsok 1/11 > > (Here I pressed Ctrl-C after a few hours (I went to bed) of sitting on test > 1/11.) It sounds as if the script gets stuck in an infinite loop. Have you looked at the test script to see why it might get stuck at that p

Re: Installing perl-5.8.8

2007-09-27 Thread Tom Phoenix
On 9/27/07, CyberDESI <[EMAIL PROTECTED]> wrote: > Here is the problem, I have RHEL AS 4 update 5 with perl v5.8.5. I would > like to install a newer version in /usr/local/perl5.8.8. I do the following: > > sh Configure -de -Dprefix=/usr/local/perl5.8.8 > make ... > Can someone point out what I am

Bundle::CPAN install error

2007-09-27 Thread Bobby
Hi, For the first time when installing this bundle I got an error. It did complete a dozen other modules but failed on the test of this one as you can see below. It seems I could either try to reinstall (which I did a few times and it always fail at the same test) or remove it. Which I have no

Re: Extracting file name from full name

2007-09-27 Thread John W. Krahn
[EMAIL PROTECTED] wrote: Hello Hello, I have a string that contains a full path and file name. What is the easiest way to extract the file name? For example the path is /dir1/dir2/dir3/file.txt. $ perl -le' use File::Basename; my $full_path = q[/dir1/dir2/dir3/file.txt]; my $file_name =

Extracting file name from full name

2007-09-27 Thread andrewmchorney
Hello I have a string that contains a full path and file name. What is the easiest way to extract the file name? For example the path is /dir1/dir2/dir3/file.txt. Andrew -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Strange debugging question...

2007-09-27 Thread Paul Johnson
On Thu, Sep 27, 2007 at 01:11:11PM -0400, Zachary Shay wrote: > Is there any way to get the name of a variable by knowing its memory > address? Some hairy XS might get you an 80% solution, but in general, no. -- Paul Johnson - [EMAIL PROTECTED] http://www.pjcj.net -- To unsubscribe, e-mail: [

Installing perl-5.8.8

2007-09-27 Thread CyberDESI
Hello, If this is the wrong place to post please point out the correct list. Here is the problem, I have RHEL AS 4 update 5 with perl v5.8.5. I would like to install a newer version in /usr/local/perl5.8.8. I do the following: sh Configure -de -Dprefix=/usr/local/perl5.8.8 make [ I get the foll

Re: Problem with repeating characters in regex

2007-09-27 Thread Rob Dixon
Mike Martin wrote: On 27/09/2007, Rob Dixon <[EMAIL PROTECTED]> wrote: Mike Martin wrote: Hi I am trying to capture only the first occurence of a charcter followed by any word ie: in this sample text !this is a first level heading !!this is a 2nd level heading I only want to find the first

Strange debugging question...

2007-09-27 Thread Zachary Shay
Is there any way to get the name of a variable by knowing its memory address? Thanks, Zach

Re: running cgi off the command line works, but running on the browser fails with a 500 error

2007-09-27 Thread Paul Lalli
On Sep 27, 11:59 am, [EMAIL PROTECTED] (Pat Rice) wrote: > Hi all > Error 500 error is the follwoing > > [Thu Sep 27 16:26:56 2007] [error] [client 10.16.153.99] Prototype mismatch: > sub main::head: none vs ($) at /var/www/cgi-bin/srHandler4.cgi line 7 > [Thu Sep 27 16:26:57 2007] [error] [client

Re: running cgi off the command line works, but running on the browser fails with a 500 error

2007-09-27 Thread Tom Phoenix
On 9/27/07, Pat Rice <[EMAIL PROTECTED]> wrote: > Line 25 -- shown below, is just a simple getstore, this works when run from > the command line, but when run form the webserver, I get above error > message, I've tried the usual 500 error messages, just wondering if anyone > has any ideas ??? A "

Re: How to set environment variable

2007-09-27 Thread Chas. Owens
On 9/27/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > can't you set the environmental variables for the parent shell > by running a script as a . or here file? snip When you use Korn, Bourne, BASH, etc. and say ". " or "source " before a script, it runs in the current process (i.e. the interp

running cgi off the command line works, but running on the browser fails with a 500 error

2007-09-27 Thread Pat Rice
Hi all Error 500 error is the follwoing [Thu Sep 27 16:26:56 2007] [error] [client 10.16.153.99] Prototype mismatch: sub main::head: none vs ($) at /var/www/cgi-bin/srHandler4.cgi line 7 [Thu Sep 27 16:26:57 2007] [error] [client 10.16.153.99] [Thu Sep 27 16:26:57 2007] srHandler4.cgi: Error 500 o

Re: How to set environment variable

2007-09-27 Thread Jeff Pang
2007/9/27, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > can't you set the environmental variables for the parent shell > by running a script as a . or here file? > Can you? you can do it via shell's `source`,but not perl. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail:

Re: How to set environment variable

2007-09-27 Thread hwigoda
can't you set the environmental variables for the parent shell by running a script as a . or here file? -Original Message- >From: Jeff Pang <[EMAIL PROTECTED]> >Sent: Sep 27, 2007 10:02 AM >To: vikram vikram vikram <[EMAIL PROTECTED]> >Cc: beginners@perl.org >Subject: Re: How to set env

Re: How to set environment variable

2007-09-27 Thread Jeff Pang
27 Sep 2007 14:47:42 -, vikram vikram vikram <[EMAIL PROTECTED]>: > > Hi All, > > I am new to perl. I am using "Active Perl-5.8.8" > > I want to set environment variable in a perl script > > Ex - #!/usr/bin/perl > $ENV{HAI} = "hai"; > > >

Re: How to set environment variable

2007-09-27 Thread Rodrick Brown
On 27 Sep 2007 14:47:42 -, vikram vikram vikram <[EMAIL PROTECTED]> wrote: > > Hi All, > > I am new to perl. I am using "Active Perl-5.8.8" > > I want to set environment variable in a perl script > > Ex - #!/usr/bin/perl > $ENV{HAI} = "hai"

How to set environment variable

2007-09-27 Thread vikram vikram vikram
  Hi All, I am new to perl. I am using "Active Perl-5.8.8" I want to set environment variable in a perl script Ex - #!/usr/bin/perl $ENV{HAI} = "hai"; and want to display the contents of the environment variable i

Re: Problem with repeating characters in regex

2007-09-27 Thread John W. Krahn
Rob Dixon wrote: Mike Martin wrote: $line=~s/\!(^\![A-Z][a-z].+)/$1/gc; $line =~ s/^!(![a-z].+)/$1/gi; You are both using an anchored pattern with the /g option which makes no sense unless you are also using the /m option. John -- Perl isn't a toolbox, but a small machine shop where y

Re: Displaying a Link on A Web PAge with image/png header.

2007-09-27 Thread Randal L. Schwartz
> "jeevs" == jeevs <[EMAIL PROTECTED]> writes: jeevs> Hi Forum!!! jeevs> I want to plot a graph on a web page. I am using the GD::Graph jeevs> module and can successfully plot the graph. The graph is displayed on jeevs> the web page with the following code. CGI questions are better asked

Re: encoding problem?

2007-09-27 Thread Rob Dixon
[EMAIL PROTECTED] wrote: I am trying to use perl on the command line to process text files in various ways, one of which is to decode html entities. As far as I can see, the following line should work perl -MHTML::Entities -p -e 'decode_entities($_)' output.txt it does indeed change the htm

Re: Problem with repeating characters in regex

2007-09-27 Thread Rob Dixon
Mike Martin wrote: Hi I am trying to capture only the first occurence of a charcter followed by any word ie: in this sample text !this is a first level heading !!this is a 2nd level heading I only want to find the first item and not the second current code $line=~s/\!(^\![A-Z][a-z].+)/$1/gc;

Re: Problem with repeating characters in regex

2007-09-27 Thread Paul Lalli
On Sep 27, 8:58 am, [EMAIL PROTECTED] (Mike Martin) wrote: > Hi I am trying to capture only the first occurence of a charcter > followed by any word ie: in this sample text > > !this is a first level heading > !!this is a 2nd level heading > > I only want to find the first item and not the second >

encoding problem?

2007-09-27 Thread braedsjaa
I am trying to use perl on the command line to process text files in various ways, one of which is to decode html entities. As far as I can see, the following line should work perl -MHTML::Entities -p -e 'decode_entities($_)' output.txt it does indeed change the html entities, but not into the r

Re: $File::Find and no_chdir

2007-09-27 Thread Paul Lalli
On Sep 27, 6:00 am, [EMAIL PROTECTED] (Schms) wrote: > I have a UNIX directory $DIR which contains a lot of files and > subdirecotires. Now, I would > > like to list all files and subdirectories in $DIR only. That means, > $File::Find should not > > go into any subdirectories of $DIR and list the

Re: Invalid top directory at d:\perl\lib\file\find.pm line 562

2007-09-27 Thread Paul Lalli
On Sep 27, 8:37 am, [EMAIL PROTECTED] (John W. Krahn) wrote: > > If i run this script i am getting the error as "Invalid top directory > > at d:\perl\lib\file\find.pm line 562, line164" > > This script doesn't have 562 lines and nowhere are you using a DATA filehandle > so it is hard to say why t

Problem with repeating characters in regex

2007-09-27 Thread Mike Martin
Hi I am trying to capture only the first occurence of a charcter followed by any word ie: in this sample text !this is a first level heading !!this is a 2nd level heading I only want to find the first item and not the second current code $line=~s/\!(^\![A-Z][a-z].+)/$1/gc; it either doesnt cap

Re: Invalid top directory at d:\perl\lib\file\find.pm line 562

2007-09-27 Thread John W. Krahn
Perler wrote: Hi, Hello, i am using the following script to find a file entered by a user. use warnings; use strict; use Win32::DriveInfo; use File::Find; my @drives = Win32::DriveInfo::DrivesInUse(); #Get the drives on a Machine my [EMAIL PROTECTED]; #Number of Drives my $i=$cnt

Re: $File::Find and no_chdir

2007-09-27 Thread John W. Krahn
schms wrote: Hi, Hello, I have a UNIX directory $DIR which contains a lot of files and subdirecotires. Now, I would like to list all files and subdirectories in $DIR only. That means, $File::Find should not go into any subdirectories of $DIR and list the files and subdirectories there as wel

Re: help regarding Comparision of two lines

2007-09-27 Thread raaki
On 26 Sep, 20:38, [EMAIL PROTECTED] (Yitzle) wrote: > On 9/26/07, raaki <[EMAIL PROTECTED]> wrote: > > > > > > > hi friends > > > recently i started learning perl.i need to print some statements after > > perticular line.in my file there is one line called "puts > > conCheckFAIL#---"occuri

Re: ::Find and no_chdir

2007-09-27 Thread Somu
Check for each name if it is a directory by -d $fname and then print it if it returns false. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Invalid top directory at d:\perl\lib\file\find.pm line 562

2007-09-27 Thread usenet
On Sep 27, 1:29 am, [EMAIL PROTECTED] (Perler) wrote: > [a multipost] Please don't multipost. -- The best way to get a good answer is to ask a good question. David Filmer (http://DavidFilmer.com) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] h

$File::Find and no_chdir

2007-09-27 Thread schms
Hi, I have a UNIX directory $DIR which contains a lot of files and subdirecotires. Now, I would like to list all files and subdirectories in $DIR only. That means, $File::Find should not go into any subdirectories of $DIR and list the files and subdirectories there as well. So far, I have not

Invalid top directory at d:\perl\lib\file\find.pm line 562

2007-09-27 Thread Perler
Hi, i am using the following script to find a file entered by a user. use Win32::DriveInfo; use File::Find; my @drives = Win32::DriveInfo::DrivesInUse(); #Get the drives on a Machine my [EMAIL PROTECTED]; #Number of Drives my $i=$cnt; #Counter assignment #The following loop appends "/"

Re: peek next line in file

2007-09-27 Thread Xavier Noria
On Sep 27, 2007, at 1:29 AM, Mahurshi Akilla wrote: Is there a way in perl to peek the next line in the file while keeping the line pointer the same? I want to do something like this: while () { //do some stuff //?? peek next line ?? and enter conditional block// //do some more

Invalid top directory at d:\perl\lib\file\find.pm line 562

2007-09-27 Thread Perler
Hi, i am using the following script to find a file entered by a user. use Win32::DriveInfo; use File::Find; my @drives = Win32::DriveInfo::DrivesInUse(); #Get the drives on a Machine my [EMAIL PROTECTED]; #Number of Drives my $i=$cnt; #Counter assignment #The following loop appends "/"

peek next line in file

2007-09-27 Thread Mahurshi Akilla
Is there a way in perl to peek the next line in the file while keeping the line pointer the same? I want to do something like this: while () { //do some stuff //?? peek next line ?? and enter conditional block// //do some more stuff } Of course, there are workarounds, but it would