RE: Subroutine getting its own path

2009-01-27 Thread Malyj, Mark
Shawn, Your code my ( $whoami ) = grep { m{ \b ServiceScript \. pl \b }msx } values %INC; print "$whoami\n"; works great!! If you have time, could you explain to a Windows guy like me what the grep is doing? Yes, I know that someone could still spoof me, but this is my first line of defense. -

Re: Subroutine getting its own path

2009-01-27 Thread mark . malyj
Sorry, I had a typo. My code snippet above should have said: require 'ServiceScript.pl'; my $svccmdline = "$uspname $uspparams"; $rtncode = ServiceRoutine($svccmdline, \...@rtndata); - Marko -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h.

Re: Simple regex problem has me baffled

2009-01-27 Thread Gunnar Hjalmarsson
Bill Harpley wrote: Hi Gunnar, I tried your suggestions but had no luck :-( (1) I tried your idea of using a paragraph separator local $/ = ''; # paragraph mode while ( my $entry = ) { if ( $entry =~ /\[([a-z0-9]{5})]/ ) { print "$1\n";

Re: Correct mailing list for VBTK module

2009-01-27 Thread Chas. Owens
On Tue, Jan 27, 2009 at 12:20, HASSAN Kamrul wrote: > > Could someone, please let me know what is the right mailing list to get > help on VBTK module, I need help on installation. snip Doesn't look like there is one; however, you could always ask the person who developed it: http://search.cpan.or

RE: Subroutine getting its own path

2009-01-27 Thread Mr. Shawn H. Corey
On Tue, 2009-01-27 at 12:27 -0500, Malyj, Mark wrote: > Your code > > my ( $whoami ) = grep { m{ \b ServiceScript \. pl \b }msx } values % > INC; > print "$whoami\n"; > > works great!! If you have time, could you explain to a Windows guy > like > me what the grep is doing? See `perldoc -f grep`

Correct mailing list for VBTK module

2009-01-27 Thread HASSAN Kamrul
Could someone, please let me know what is the right mailing list to get help on VBTK module, I need help on installation. Thank you. Kamrul Hassan Alcatel-Lucent GNOC IT Development and Architecture (972) 477 8792 kamrul.has...@alcatel-lucent.com -- To unsubscribe, e-mail: beginners-unsubscr.

Re: Subroutine getting its own path

2009-01-27 Thread Mr. Shawn H. Corey
On Mon, 2009-01-26 at 15:07 -0800, mark.ma...@gdit.com wrote: > My question is this – how can my ServiceRoutine in ServiceScript.pl > get its own path? I would like to record this to the database for > auditing purposes as well, to make sure no one is using a substitute > version of ServiceRoutine

RE: Simple regex problem has me baffled

2009-01-27 Thread Bill Harpley
Rob, Thanks for your suggestion. It worked!! # script.pl 8252c 8252c 8252d 8252d 82534 82535 82535 82534 8253c 8253c 8253f 8253f 82542 82543 <- big long list -> So this is what did the trick: while () { next unless /RequestId \[([[:xdigit:]]+)\]/; print "$1\n"; } Can you explain w

RE: Simple regex problem has me baffled

2009-01-27 Thread Bill Harpley
Hi Gunnar, I tried your suggestions but had no luck :-( (1) I tried your idea of using a paragraph separator local $/ = ''; # paragraph mode while ( my $entry = ) { if ( $entry =~ /\[([a-z0-9]{5})]/ ) { print "$1\n"; } }

RE: Simple regex problem has me baffled

2009-01-27 Thread Bill Harpley
Hi John, Thanks for your advice. (1) I actually have 'use warnings' enabled in the complete script. 'use strict' just gives me a load of unrelated compilation errors like "Global symbol "$INBOX" requires explicit package name at ./magic.pl line 8." (2) I have also tried a WHILE loop

Subroutine getting its own path

2009-01-27 Thread mark . malyj
I’m a database guy, but Perl is new to me. I have a script called ServiceScript.pl that contains a subroutine called ServiceRoutine. This routine connects to a database and returns data into an array. I want my customer to be able to call this subroutine from any of their hundreds of perl scripts,

Help with modules and objects

2009-01-27 Thread Bill
I'm not a beginner with perl but all of my previous stuff has been simple and I've never really used modules, until now. I'm working on a program that has to receive a mime encoded email and pull info out of it. I'm using Email::Simple and Email:MIME and I can read the emails fine but I'm having

RE: Simple regex problem has me baffled

2009-01-27 Thread Bill Harpley
Hi Shawn, Here is the revised code fragment: open ( DATA, "< $INBOX/nlsrysows001_2090125.dat") || die "Cannot open source file: $!"; open ( FILE, "> $INBOX/request.dat") || die "Cannot open request file: $!"; chomp(@list=); foreach $entry(@list) { $entry =~ /\[([a-z0-9]{5})\]/;

Re: Query in Perl Programming

2009-01-27 Thread Gunnar Hjalmarsson
S, Rajini (STSD) wrote: Hi, I am new to Perl Programming and have a query in perl. In perl is there any system defined functions to find out the Differences in dates. Eg : Date 1 -> 26-Jan-2009 Date 2 -> 14-Jan-2009 So the difference between two dates is 12 days. Is there a way to ac

Re: Query in Perl Programming

2009-01-27 Thread rhosto
On Jan 26, 9:37 pm, rajin...@hp.com (Rajini S) wrote: > Hi, > > I am new to Perl Programming and have a query in perl. > > In perl is there any system defined functions to find out the > Differences in dates. > > Eg : > > Date 1 -> 26-Jan-2009 > Date 2 -> 14-Jan-2009 > > So the difference between t