Re: transliterate the negative character class in perl

2009-09-25 Thread Uri Guttman
> "RC" == Robert Citek writes: RC> How does one transliterate in perl using a negated character class? RC> For example, I have a string abcxyz and I would like to turn it into RC> abNNNz. I've been able to do the following: RC> $ echo "abcxyz" | perl -plane '$_ =~ y/[abz]/N/ ' RC>

Re: export symbols across directories

2009-09-25 Thread Uri Guttman
> "STF" == Stanisław T Findeisen writes: STF> I am trying to use symbols from Utils.pm without qualifying them with STF> package name. I have 2 files: STF> # STF> # File Utils.pm STF> # STF> package Utils; STF> our @EXPOR

Re: export symbols across directories

2009-09-25 Thread Shawn H Corey
Stanisław T. Findeisen wrote: When I, however, move Utils.pm into subdirectory mylib, and modify the program accordingly: # # The program (2) # use warnings; use strict; use mylib::Utils qw(bar foo); use lib './mylib'; use Utils qw(foo ba

Re: transliterate the negative character class in perl

2009-09-25 Thread Shawn H Corey
Robert Citek wrote: How does one transliterate in perl using a negated character class? For example, I have a string abcxyz and I would like to turn it into abNNNz. I've been able to do the following: $ echo "abcxyz" | perl -plane '$_ =~ y/[abz]/N/ ' NNcxyN so I figured negating would give me

export symbols across directories

2009-09-25 Thread Stanisław T. Findeisen
I am trying to use symbols from Utils.pm without qualifying them with package name. I have 2 files: # # File Utils.pm # package Utils; use warnings; use strict; use base 'Exporter'; our @EXPORT_OK = ('foo', 'bar'); sub foo { print "foo

transliterate the negative character class in perl

2009-09-25 Thread Robert Citek
How does one transliterate in perl using a negated character class? For example, I have a string abcxyz and I would like to turn it into abNNNz. I've been able to do the following: $ echo "abcxyz" | perl -plane '$_ =~ y/[abz]/N/ ' NNcxyN so I figured negating would give me the negated set, but

Perl script

2009-09-25 Thread Irfan Sayed
Hi All, I am planning to wrire the perl script which will accomplish following task 1: login to remote windows machine 2: verify certain batch scripts are running or not Please let me know if this can be possible using perl script. Regards Irf

Re: transliterate the negative character class in perl

2009-09-25 Thread Uri Guttman
> "SHC" == Shawn H Corey writes: SHC> echo "abcxyz" | perl -ple '$_ =~ tr/abz/N/c' you don't need the $_ there as tr/// will default to using it. uri -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org

Re: Perl script

2009-09-25 Thread Shawn H Corey
Irfan Sayed wrote: Hi All, I am planning to wrire the perl script which will accomplish following task 1: login to remote windows machine 2: verify certain batch scripts are running or not Please let me know if this can be possible using perl script. Yes, it's possible. -- Just my 0.00

Re: Perl script

2009-09-25 Thread Gabor Szabo
On Fri, Sep 25, 2009 at 1:19 PM, Irfan Sayed wrote: > Hi All, > > I am planning to wrire the perl script which will accomplish following task > > 1: login to remote windows machine > 2: verify certain batch scripts are running or not > > Please let me know if this can be possible using perl script

Re: Perl script

2009-09-25 Thread 叶孤城
2009/9/25 Shawn H Corey : > Irfan Sayed wrote: >> >> Hi All, >> >> I am planning to wrire the perl script which will accomplish following >> task >> >> 1: login to remote windows machine >> 2: verify certain batch scripts are running or not >> reference this: http://www.novell.com/coolsolutions/fe

Re: transliterate the negative character class in perl

2009-09-25 Thread Robert Citek
On Fri, Sep 25, 2009 at 5:46 AM, Shawn H Corey wrote: > Robert Citek wrote: >> >> How does one transliterate in perl using a negated character class? > > echo "abcxyz" | perl -ple '$_ =~ tr/abz/N/c' > > See `perldoc perlop` and search for /tr\/SEARCHLIST\/REPLACEMENTLIST\/cds/ Thanks. I took a l

Re: numeric comparison always returning true!

2009-09-25 Thread pablo
Thanks for the responses, I appreciate the help. As pointed out, I was storing comparing one value and printing another. I guess my initial question has been answered: Quote: "Am I missing something obvious, or is there something wrong here?" My only remaining question is what's the benefit of

Re: transliterate the negative character class in perl

2009-09-25 Thread Uri Guttman
> "RC" == Robert Citek writes: RC> On Fri, Sep 25, 2009 at 5:46 AM, Shawn H Corey wrote: >> Robert Citek wrote: >>> >>> How does one transliterate in perl using a negated character class? >> >> echo "abcxyz" | perl -ple '$_ =~ tr/abz/N/c' >> >> See `perldoc perlop` and se

Re: numeric comparison always returning true!

2009-09-25 Thread Uri Guttman
> "p" == pablo writes: p> Thanks for the responses, I appreciate the help. As pointed out, I was p> storing comparing one value and printing another. I guess my initial p> question has been answered: p> Quote: p> "Am I missing something obvious, or is there something wrong here?

hash question

2009-09-25 Thread Johnson, Reginald (GTS)
I don't see what I am doing wrong in printing out the values in the hash. I am inputting a file with records of varying number of fields and want to put them in a hash. My output says Use of uninitialized value in concatenation (.) or string at sample.pl line 35, line 1. => test2 Sample input fi

Re: hash question

2009-09-25 Thread Jim Gibson
On 9/25/09 Fri Sep 25, 2009 10:05 AM, "Johnson, Reginald (GTS)" scribbled: > I don't see what I am doing wrong in printing out the values in the > hash. I am inputting a file with records of varying number of fields and > want to put them in a hash. My output says Use of uninitialized value in

Re: hash question

2009-09-25 Thread Uri Guttman
> "JR(" == Johnson, Reginald (GTS) writes: JR(> Sample input file "test2,MS-Windows-NT,Silver,NPRO30DINCR,Client JR(> JXWGTI7R5CHD1 WINDOWS NT,Schedule test2_full_1700 FULL 604800" JR(> print "Enter the filename of input file with full path\n"; JR(> my $input_file = <>;

Re: numeric comparison always returning true!

2009-09-25 Thread pablo
> and we pointed it out several times to you before you got it. next time > i break out the sledgehammer! :) You did, sorry I missed it. > use warnings is lexically scoped so you can confine it to just the > module, file or block. -w sets the global warnings flag. one major > difference would be

RE: hash question

2009-09-25 Thread Johnson, Reginald (GTS)
Uri, Thank you for the assistance. I have incorporated data dumper and the " " into the code. What I find odd is that data dumper shows the values of the hash as I expect them to be. Yet still when I print I get a hex number. My output Enter the filename of input file with full path /tmp/reggiej

Re: hash question

2009-09-25 Thread Steve Bertrand
Johnson, Reginald (GTS) wrote: > Uri, > Thank you for the assistance. I have incorporated data dumper and the " > " into the code. What I find odd is that data dumper shows the values of > the hash as I expect them to be. Yet still when I print I get a hex > number. > > My output > > Enter the f

Re: hash question

2009-09-25 Thread Jim Gibson
On 9/25/09 Fri Sep 25, 2009 12:48 PM, "Johnson, Reginald (GTS)" scribbled: > Uri, > Thank you for the assistance. I have incorporated data dumper and the " > " into the code. What I find odd is that data dumper shows the values of > the hash as I expect them to be. Yet still when I print I get

Using named params

2009-09-25 Thread Steve Bertrand
Hi all, I've read a fair bit about named params, and have been hit by bugs by overlapping lists into hashes etc. Below is a method that essentially isn't truly a 'captcha', but is something I use to 'ensure' that the person clicking the submit button on a web gui isn't clicking by accident. This