RE: call one perl script within another

2003-10-21 Thread Geer, David van der
> How Can I call a perl script within my main script > If I do > $response=`perl $somescript $args`; This will fork and open a shell so is slow >do "$somescript $args"; > But How do I get the reponse of the script. > Is there a way or should I just use the backticks Please look at sys

Re: File sorting by a specific date

2003-10-21 Thread Paul Harwood
This isn't working for some reason. The $date scalar seems unchanged throughout. Paul Harwood wrote: > > I want to search a directory of log files and populate a list of those > log files ONLY if they match today's date (localtime). > > $logs = 'c:\logs\W3SVC1'; > opendir LOGS, "$logs" or die "C

Re: Beginning beginner needing references help

2003-10-21 Thread Darin McBride
Jonathan Mangin wrote: > Jeez, this is a beginner's list? Y'all are defining my ignorance of this > here purrl stuff. I hope someone with patience can help me out. In a > simple login/registration program using 5.6.1... > > #!/usr/bin/perl -wT > use strict; > > [CGI and DBI stuff] IOW, importan

Re: Apache::Session vs CGI::Session

2003-10-21 Thread Andrew Shitov
Does opening a new browser causes a new session in either of the two? What for are you going to use sessions? I mean: is threr a real necessity of using some modules? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: call one perl script within another

2003-10-21 Thread Andrew Shitov
This will call a new perl process, and may be more expensive on the system. On the other hand I can do <...> But How do I get the reponse of the script. Probably the simpliest way is to make called script a module and run it using either 'use' or 'require'. -- To unsubscribe, e-mail: [EMAIL PROT

Re: Beginning beginner needing references help

2003-10-21 Thread Rob Dixon
Jonathan Mangin wrote: > > Jeez, this is a beginner's list? Y'all are defining my > ignorance of this here purrl stuff. I hope someone with > patience can help me out. In a simple login/registration > program using 5.6.1... > > #!/usr/bin/perl -wT > use strict; > > [CGI and DBI stuff] > > $countryi

Re: Tokens??

2003-10-21 Thread Rob Dixon
<[EMAIL PROTECTED]> wrote: > > I am brand new to Perl and I am trying to modify a script that > someone else wrote. > > > I have this line where primaryntaccount = something like this > domainname\userid > > Token=primaryntaccount:: %ntaccount% = (\\w+).*$ > > I want to pass a different value for p

javascript Parsing

2003-10-21 Thread Francesco del Vecchio
Hi to all, I need to parse javascript into web pages to substitute all relative addresses to absolute ones. I do this job in the HTML using LWP but I'm having bad times trying to do it into javascript contained in the page. Can anyone help me? Frank __ Do you

Re: call one perl script within another

2003-10-21 Thread Ramprasad A Padmanabhan
Andrew Shitov wrote: This will call a new perl process, and may be more expensive on the system. On the other hand I can do <...> But How do I get the reponse of the script. Probably the simpliest way is to make called script a module and run it using either 'use' or 'require'. Precisely , Bu

Re: How do you find out the size of a file

2003-10-21 Thread Rob Dixon
John W. Krahn wrote: > Chinku Simon wrote: > > > I have a requirement to find out the size of a file existing > > in an NTFS file system. > > my $file_size = -s $file_name; > > perldoc -f -s Thanks John. It's also worth pointing out that the '-s' operator is /indentical/ to calling 'stat' and tak

Re: call one perl script within another

2003-10-21 Thread Randal L. Schwartz
> "David" == David Van Der Geer <[EMAIL PROTECTED]> writes: David> * David> This message is intended only for the person or entity to David> which it is addressed and may contain confidential and/or David> privileged informat

Re: Beginning beginner needing references help

2003-10-21 Thread R. Joseph Newton
Jonathan Mangin wrote: > Jeez, this is a beginner's list? Y'all are defining my ignorance of this here purrl > stuff. > I hope someone with patience can help me out. In a simple login/registration program > using 5.6.1... > > #!/usr/bin/perl -wT > use strict; Something is screwy here ... > [CGI

Re: Beginning beginner needing references help

2003-10-21 Thread Rob Dixon
Hi Joseph. R. Joseph Newton wrote: > > Jonathan Mangin wrote: > > > > Jeez, this is a beginner's list? Y'all are defining my > > ignorance of this here purrl stuff. I hope someone with > > patience can help me out. In a simple login/registration > > program using 5.6.1... > > > > #!/usr/bin/perl

RE: call one perl script within another

2003-10-21 Thread Geer, David van der
> As I've said before: > >You have exceeded the 4-line .sig boilerplate limit with a >worthless unenforcable disclaimer. Please remove this text from >future postings to this mailing list. If you cannot do so for >mail from your domain, please get a freemail account and rejoin >

Re: call one perl script within another

2003-10-21 Thread Wiggins d Anconia
> Andrew Shitov wrote: > >> This will call a new perl process, and may be more expensive on the > >> system. On the other hand I can do > > > > <...> > > > >> But How do I get the reponse of the script. > > > > > > Probably the simpliest way is to make called script a module and run it > >

Re: call one perl script within another

2003-10-21 Thread Dan Anderson
I think there's a function called eval which lets you evaluate perl code on the fly. http://www.perldoc.com/perl5.8.0/pod/func/eval.html -Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Beginning beginner needing references help

2003-10-21 Thread Jonathan Mangin
- Original Message - From: "Rob Dixon" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, October 21, 2003 4:31 AM Subject: Re: Beginning beginner needing references help > Jonathan Mangin wrote: > > > > Jeez, this is a beginner's list? > > Thank you for all the responses. I'll t

Parsing pipe delimited file

2003-10-21 Thread Kevin Old
Hello everyone, Thanks to everyone who helped with my last problem last week. I've hit a snag in another problem this week. I need to parse the following data: "COUNTRY MUSIC HALL OF FAME UPC#: 0-84296-22922-2"||"COUNTRY FEMALE PARTY SONGS VOL. 2 UPC#: 0-84296-28682-9"||"COUNTRY MALE

Re: Beginning beginner needing references help

2003-10-21 Thread Rob Dixon
Hi Jonathan. This thread needs splitting. And you need to formulate and ask one question at a time. There's no use in starting with an entire program that doesn't work and trying to fix it. Model each of your problems in a tiny piece of Perl and fix them one at a time. It will help you as well as

Re: Parsing pipe delimited file

2003-10-21 Thread Rob Dixon
Kevin Old wrote: > > Thanks to everyone who helped with my last problem last week. I've hit > a snag in another problem this week. > > I need to parse the following data: [snip] I'd like to help Kevin, but please post your data as an attachment or (even better) as an Internet link. Line wrappi

IO::Filter::gzip question

2003-10-21 Thread Jose Malacara
Can someone tell me how to extract the uncompressed data from the returned value using the script below? I try and print the $fio variable, but I get some hash reference. Do I need to iterate through this hash and then print the values or am I just going about this all wrong? I am trying to just

Re: Parsing pipe delimited file

2003-10-21 Thread Kevin Old
On Tue, 2003-10-21 at 13:54, Rob Dixon wrote: > Kevin Old wrote: > > > > Thanks to everyone who helped with my last problem last week. I've hit > > a snag in another problem this week. > > > > I need to parse the following data: > > [snip] > > > > I'd like to help Kevin, but please post your d

Re: File sorting by a specific date

2003-10-21 Thread Kevin Pfeiffer
Hi, In article <[EMAIL PROTECTED]>, Paul Harwood purportedly wrote: > This isn't working for some reason. The $date scalar seems unchanged > throughout. > > Paul Harwood wrote: >> >> I want to search a directory of log files and populate a list of those >> log files ONLY if they match today's

Re: call one perl script within another

2003-10-21 Thread Andrew Shitov
my $return_value = eval {$code_or_sub_programme}; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Parsing pipe delimited file

2003-10-21 Thread Kevin Pfeiffer
In article <[EMAIL PROTECTED]>, Rob Dixon wrote: > Kevin Old wrote: >> >> Thanks to everyone who helped with my last problem last week. I've hit >> a snag in another problem this week. >> >> I need to parse the following data: > > [snip] > > > > I'd like to help Kevin, but please post your da

RE: alias in the shell

2003-10-21 Thread LoBue, Mark
Someone is missing the point, I'm not sure who yet. > -Original Message- > From: Steve Grazzini [mailto:[EMAIL PROTECTED] > Sent: Friday, October 17, 2003 10:10 PM > To: Smoot Carl-Mitchell > Cc: [EMAIL PROTECTED] > Subject: Re: alias in the shell > > > On Fri, Oct 17, 2003 at 04:05:10PM

Sed command in Perl

2003-10-21 Thread Raghu Murthy
How do I include a sed command in perl. If i do sed -e"s\./ " file_name it works fine at the command prompt. But if i include the sed command in perl it does not return any value. I tried doing system("sed -e"s\./.." file_name"); it does not do anything. Is there something wrong in how i ha

Re: alias in the shell

2003-10-21 Thread Steve Grazzini
On Tue, Oct 21, 2003 at 11:35:15AM -0700, LoBue, Mark wrote: > Someone is missing the point, I'm not sure who yet. I'll admit to going on a tangent... :-) The original topic was how to create a shell alias from Perl. > No, that won't work, because the alias command is running in a forked child.

Trivial 'unless' Question

2003-10-21 Thread Jeff Westman
Hi . very trivial ... is there a way or correct syntax to add an 'if' tp the following 'unless' statement? # this works fine ... print "first\n" unless ($counter); # ... but can I do something like print "first\n" unless ($counter) else { print "second\n"; # (syntax error) I know I can do

Re: Sed command in Perl

2003-10-21 Thread Steve Grazzini
On Tue, Oct 21, 2003 at 02:45:50PM -0400, Raghu Murthy wrote: > How do I include a sed command in perl. > > If i do sed -e"s\./ " file_name it works fine at the command prompt. > But if i include the sed command in perl it does not return any value. > > I tried doing system("sed -e"s\./.." f

Re: Trivial 'unless' Question

2003-10-21 Thread Steve Grazzini
On Tue, Oct 21, 2003 at 12:17:17PM -0700, Jeff Westman wrote: > # ... but can I do something like > print "first\n" unless ($counter) else { print "second\n"; Not really. You could use the conditional operator, though. print $counter ? "second\n" : "first\n"; -- Steve -- To unsubscribe

RE: alias in the shell

2003-10-21 Thread LoBue, Mark
> -Original Message- > From: Steve Grazzini [mailto:[EMAIL PROTECTED] > Sent: Tuesday, October 21, 2003 11:43 AM > To: LoBue, Mark > Cc: [EMAIL PROTECTED] > Subject: Re: alias in the shell > > > On Tue, Oct 21, 2003 at 11:35:15AM -0700, LoBue, Mark wrote: > > Someone is missing the point,

Re: Trivial 'unless' Question

2003-10-21 Thread Jeff Westman
Steve Grazzini <[EMAIL PROTECTED]> wrote: > On Tue, Oct 21, 2003 at 12:17:17PM -0700, Jeff Westman wrote: > > # ... but can I do something like > > print "first\n" unless ($counter) else { print "second\n"; > > Not really. You could use the conditional operator, though. > > print $counter

Re: Trivial 'unless' Question

2003-10-21 Thread Steve Grazzini
On Tue, Oct 21, 2003 at 01:06:44PM -0700, Jeff Westman wrote: > Steve Grazzini <[EMAIL PROTECTED]> wrote: > > On Tue, Oct 21, 2003 at 12:17:17PM -0700, Jeff Westman wrote: > > > # ... but can I do something like > > > print "first\n" unless ($counter) else { print "second\n"; > > > > Not reall

Re: Parsing pipe delimited file

2003-10-21 Thread Kevin Pfeiffer
In article <[EMAIL PROTECTED]>, Kevin Old wrote: [...] > I need to parse the following data: > > "COUNTRY MUSIC HALL OF FAME UPC#: 0-84296-22922-2"||"COUNTRY FEMALE > PARTY SONGS VOL. 2 UPC#: 0-84296-28682-9"||"COUNTRY MALE PARTY > SONGS VOL. 2 UPC#: 0-84296-28652-2"||| ||

Re: Parsing pipe delimited file

2003-10-21 Thread Katy Brownfield
Exactly what structure you want to end up with isn't clear, but I assume you that you need to keep the tracks and artists associated with their UPCs. If there were only one upc and one track/artist per line, grouped by upc, it would be easier. The position of the track/artist on each line is wh

Re: Trivial 'unless' Question

2003-10-21 Thread Kevin Pfeiffer
In article <[EMAIL PROTECTED]>, Steve Grazzini wrote: > On Tue, Oct 21, 2003 at 01:06:44PM -0700, Jeff Westman wrote: >> Steve Grazzini <[EMAIL PROTECTED]> wrote: >> > On Tue, Oct 21, 2003 at 12:17:17PM -0700, Jeff Westman wrote: >> > > # ... but can I do something like >> > > print "first\n"

Re: Parsing pipe delimited file

2003-10-21 Thread Kevin Old
On Tue, 2003-10-21 at 16:49, Kevin Pfeiffer wrote: > In article <[EMAIL PROTECTED]>, Kevin Old wrote: > [...] > > I need to parse the following data: > > > > "COUNTRY MUSIC HALL OF FAME UPC#: 0-84296-22922-2"||"COUNTRY FEMALE > > PARTY SONGS VOL. 2 UPC#: 0-84296-28682-9"||"COUNTRY MALE P

Re: IO::Filter::gzip question

2003-10-21 Thread Wiggins d Anconia
> Can someone tell me how to extract the uncompressed data from the returned value using the script below? I try and print the $fio variable, but I get some hash reference. Do I need to iterate through this hash and then print the values or am I just going about this all wrong? I am trying to just

RE: Trivial 'unless' Question

2003-10-21 Thread Perry, Alan
On Tuesday, October 21, 2003 16:01, Kevin Pfeiffer wrote: >In article <[EMAIL PROTECTED]>, Steve Grazzini wrote: > >> On Tue, Oct 21, 2003 at 01:06:44PM -0700, Jeff Westman wrote: >>> Steve Grazzini <[EMAIL PROTECTED]> wrote: >>> > On Tue, Oct 21, 2003 at 12:17:17PM -0700, Jeff Westman wrote: >>>

Re: Parsing pipe delimited file

2003-10-21 Thread Kevin Pfeiffer
In article <[EMAIL PROTECTED]>, Kevin Old wrote: [...] > Then the rest of the lines are "Tracks" and "Artists". What I need to > do is get the appropriate tracks and artists in respective (@tracks, > @artists) arrays inside the hash. > > Basically, I need to know how to write code that does this

Re: Parsing pipe delimited file

2003-10-21 Thread Kevin Pfeiffer
In article <[EMAIL PROTECTED]>, Kevin Pfeiffer wrote: [...] > The thing to add (I'd have to check the Perl Cookbook for the terminology) > is a "reverse lookup"(?) so that in addition to: > > $album{$upc} > > you could also access your data via: > > $album{$album_name} > > (I think -- trying to

how to extract data in specified format to another file

2003-10-21 Thread Mythili, Chandrasekaran (C.)
HI, I am new to Perl and I need some help regarding tranfering the contents of one file to other file in specified format using perl. the problem is i have one file with data(data is in hex) as follows: 48 30 20 2E 2E 2E 0 0 0 i want to copy the contents of this file to another file till 0 is en

Re: Tokens??

2003-10-21 Thread R. Joseph Newton
PerlDiscuss - Perl Newsgroups and mailing lists wrote: > HI, > > I am brand new to Perl and I am trying to modify a script that someone > else wrote. Please don't. That is not the way to learn Perl. Learn Perl first, get very confortable with it, starting with the basics, then try to adapt exis

Re: javascript Parsing

2003-10-21 Thread R. Joseph Newton
Francesco del Vecchio wrote: > Hi to all, > > I need to parse javascript into web pages to substitute all relative addresses to > absolute ones. Why? Are you in a masochistic frame of mind? > > > I do this job in the HTML using LWP but I'm having bad times trying to do it into > javascript >

Re: Parsing pipe delimited file

2003-10-21 Thread R. Joseph Newton
Kevin Old wrote: > Hello everyone, > > Thanks to everyone who helped with my last problem last week. I've hit > a snag in another problem this week. > > I need to parse the following data: > > "COUNTRY MUSIC HALL OF FAME UPC#: 0-84296-22922-2"||"COUNTRY FEMALE > PARTY SONGS VOL. 2 UPC#: 0-8

Re: how to extract data in specified format to another file

2003-10-21 Thread Kevin Pfeiffer
In article <[EMAIL PROTECTED]>, Chandrasekaran Mythili wrote: > HI, > > I am new to Perl and I need some help regarding tranfering the contents of > one file to other file in specified format using perl. > > the problem is i have one file with data(data is in hex) as follows: > 48 > 30 > 20 > 2E

Re: how to extract data in specified format to another file

2003-10-21 Thread Kevin Pfeiffer
In article <[EMAIL PROTECTED]>, Kevin Pfeiffer wrote: [...] > while () { > > chomp; > print; > last if /^0$/; > } > > print "\n"; Whoops, too fast for my own good (points off for carelessness): while () { chomp; print unless /^0$/; } print "\n"; __END__ But what I'm not