Re: system()

2008-05-19 Thread John W. Krahn
schms wrote: I am trying to run the following system() command. It seems as Perl is not able to handover $POLICYNAME to the Unix shell It *looks* like you are trying to hand over $POLICYNAME to /usr/openv/netbackup/bin/admincmd/bpplinfo and not to the shell. Whether or not system() invokes a

Re: How do I find the key of a specific hash element?

2008-05-19 Thread Randal L. Schwartz
> "jshock" == jshock <[EMAIL PROTECTED]> writes: jshock> For example: jshock> my %weekdays = ( jshock> 0 => "SUN", jshock> 1 => "MON", jshock> 2 => "TUE", jshock> 3 => "WED", jshock> 4 => "THU", jshock> 5 => "FRI", jshock> 6 => "SAT", j

Re: How do I find the key of a specific hash element?

2008-05-19 Thread Dr.Ruud
Rob Dixon schreef: > Dr.Ruud: >> perl -le' >> #!/usr/bin/perl >> use strict; >> use warnings; >> >> my @n2d = qw( SUN MON TUE WED THU FRI SAT ); >> my %d2n; @d2n{ @n2d } = ( 0 .. $#n2d ); >> >> print $d2n{ WED }; >> ' >> 3 > > It doesn't help to write UNIX shell commands when we are talk

Re: How do I find the key of a specific hash element?

2008-05-19 Thread Gunnar Hjalmarsson
Rob Dixon wrote: Dr.Ruud wrote: perl -le' #!/usr/bin/perl use strict; use warnings; my @n2d = qw( SUN MON TUE WED THU FRI SAT ); my %d2n; @d2n{ @n2d } = ( 0 .. $#n2d ); print $d2n{ WED }; ' 3 It doesn't help to write UNIX shell commands when we are talking about a cross-platform l

Re: system()

2008-05-19 Thread Chas. Owens
On Mon, May 19, 2008 at 6:21 AM, schms <[EMAIL PROTECTED]> wrote: snip > while () { snip you need a chomp here snip >my $POLICYNAME = $_; > >my @args = ("/usr/openv/netbackup/bin/admincmd/bpplinfo > $POLICYNAME -modify -inactive"); snip this is a pointless use of an array with on

Re: How do I find the key of a specific hash element?

2008-05-19 Thread Rob Dixon
Dr.Ruud wrote: > jshock schreef: >> For example: >> >> my %weekdays = ( >> 0 => "SUN", >> 1 => "MON", >> 2 => "TUE", >> 3 => "WED", >> 4 => "THU", >> 5 => "FRI", >> 6 => "SAT", >> ); >> $weekdays{2}; # gives "TUE" >> >> But what if I know "TUE" and want to find out what the key is? Is >> there a c

Re: How do I find the key of a specific hash element?

2008-05-19 Thread Rob Dixon
jshock wrote: > > For example: > > my %weekdays = ( > 0 => "SUN", > 1 => "MON", > 2 => "TUE", > 3 => "WED", > 4 => "THU", > 5 => "FRI", > 6 => "SAT", > ); All those double quotes without any interpolation? my %weekdays; @weekdays{0..6}= qw/SUN MON T

Re: How do I find the key of a specific hash element?

2008-05-19 Thread Dr.Ruud
jshock schreef: > For example: > > my %weekdays = ( > 0 => "SUN", > 1 => "MON", > 2 => "TUE", > 3 => "WED", > 4 => "THU", > 5 => "FRI", > 6 => "SAT", > ); > $weekdays{2}; # gives "TUE" > > But what if I know "TUE" and want to find out what the key is? Is > there a construct like $weekdays{"TUE"}

RE: How do I find the key of a specific hash element?

2008-05-19 Thread Wagner, David --- Senior Programmer Analyst --- WGO
> -Original Message- > From: jshock [mailto:[EMAIL PROTECTED] > Sent: Monday, May 19, 2008 07:20 > To: beginners@perl.org > Subject: How do I find the key of a specific hash element? > > For example: > > my %weekdays = ( > 0 => "SUN", > 1 => "MON", > 2 => "TUE", >

How do I find the key of a specific hash element?

2008-05-19 Thread jshock
For example: my %weekdays = ( 0 => "SUN", 1 => "MON", 2 => "TUE", 3 => "WED", 4 => "THU", 5 => "FRI", 6 => "SAT", ); $weekdays{2}; # gives "TUE" But what if I know "TUE" and want to find out what the key is? Is there a construct like $weekd

system()

2008-05-19 Thread schms
I am trying to run the following system() command. It seems as Perl is not able to handover $POLICYNAME to the Unix shell and that the shell gets a problem with the strings - modify and -inactive as they contain a minus (-). Is there a way to run the command /usr/openv/netbackup/bin/admincmd/bppli

Re: cgi ordering a table with sql

2008-05-19 Thread Gunnar Hjalmarsson
Pat Rice wrote: I'm trying to achieve the following a table that when I click on the top link I will chance the ORDER BY value in the table. eg |fruit | boxes | |orange | 10| |apples | 5 | so if fruit was a link and I clicked it I would change my select statement to order by fruit, if

scaling text

2008-05-19 Thread Robert L Hicks
Is there an algorithm to scale text on a graphic? I have a badge 200x200 that I would like to scale text on. I have looked at a bunch of Perl image libraries ( o_O ) but I didn't see an example. Robert -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTE

Re: Multiline comment in Perl

2008-05-19 Thread Octavian Rasnita
From: "Rob Dixon" <[EMAIL PROTECTED]> Yes, I'm afraid I misquoted the entry from perlfaq7, which actually recommends =begin comment : =end comment =cut which is clumsy, to say the least. However I use =begin comment : =cut which works fine, and I don't think contravenes POD syntax except t

Re: Multiline comment in Perl

2008-05-19 Thread Rob Dixon
Octavian Rasnita wrote: > > From: "Rob Dixon" <[EMAIL PROTECTED]> >> >> The documentation that John referred you to recommends >> >> =begin comment >>: >> =end >> >> Which may be a trifle awkward, but I'm sure there are worse things that >> happen >> to you in your day. It takes less than a

RE: question regarding how to launch perl script on remote machine

2008-05-19 Thread Bob McConnell
From: Richard Lee > ok so let's say on SERVERK, I cannot install any modules(no root access > and different compilers, gcc(I have tried perlgcc but to no success), > and other > reasons that I cannot explain nor understand and after numerous > attempts(installing my own dir and others), I have g

Re: question regarding how to launch perl script on remote machine

2008-05-19 Thread Richard Lee
Matthew Whipple wrote: That would depend upon which side that command was executed. Keep in mind that he had mentioned a script that would iniate the SSH connection from the Solaris computer and could retrieve data from that computer which could then be passed over the connection. I unfortuna

Re: Multiline comment in Perl

2008-05-19 Thread Aruna Goke
Octavian Rasnita wrote: From: "Rob Dixon" <[EMAIL PROTECTED]> The documentation that John referred you to recommends =begin comment : =end Which may be a trifle awkward, but I'm sure there are worse things that happen to you in your day. It takes less than a second to type, and if you do

cgi ordering a table with sql

2008-05-19 Thread Pat Rice
hi all I'm trying to achieve the following a table that when I click on the top link I will chance the ORDER BY value in the table. eg |fruit | boxes | |orange | 10| |apples | 5 | so if fruit was a link and I clicked it I would change my select statement to order by fruit, if I clicked o

Re: Multiline comment in Perl

2008-05-19 Thread Octavian Rasnita
From: "Rob Dixon" <[EMAIL PROTECTED]> The documentation that John referred you to recommends =begin comment : =end Which may be a trifle awkward, but I'm sure there are worse things that happen to you in your day. It takes less than a second to type, and if you do it a lot you could set

Re: question regarding how to launch perl script on remote machine

2008-05-19 Thread Matthew Whipple
On Mon, 2008-05-19 at 22:08 +0800, Jeff Peng wrote: > On Mon, May 19, 2008 at 10:01 PM, Matthew Whipple > <[EMAIL PROTECTED]> wrote: > > > > It sounded as though he wanted to run the script on the Linux machine, > > not the server... > > That was maybe not correct. > Given the case that he say so

Re: question regarding how to launch perl script on remote machine

2008-05-19 Thread Jeff Peng
On Mon, May 19, 2008 at 10:01 PM, Matthew Whipple <[EMAIL PROTECTED]> wrote: > > It sounded as though he wanted to run the script on the Linux machine, > not the server... That was maybe not correct. Given the case that he say something like this in his script: open $pwd, "/etc/passwd" or die $!;

Re: perl and web

2008-05-19 Thread Jeff Peng
On Mon, May 19, 2008 at 12:48 AM, yitzle <[EMAIL PROTECTED]> wrote: > See: > http://search.cpan.org/~petdance/WWW-Mechanize-1.34/lib/WWW/Mechanize.pm#$mech-%3Ecredentials(_$username,_$password_) > > $mech->credentials( $username, $password ) > See also the example uses of WWW::Mechanize: http://se

Re: question regarding how to launch perl script on remote machine

2008-05-19 Thread Matthew Whipple
On Mon, 2008-05-19 at 21:55 +0800, Jeff Peng wrote: > On Mon, May 19, 2008 at 11:22 AM, Richard Lee <[EMAIL PROTECTED]> wrote: > > > I have thought of writing a simple shell script which launchs a (from > > SERVERK)ssh session into linux machines using user name with initial script > > to run a p

Re: question regarding how to launch perl script on remote machine

2008-05-19 Thread Jeff Peng
On Mon, May 19, 2008 at 11:22 AM, Richard Lee <[EMAIL PROTECTED]> wrote: > I have thought of writing a simple shell script which launchs a (from > SERVERK)ssh session into linux machines using user name with initial script > to run a perl script and logs off.. Is this possible? I don't think so.

Re: Upgrade Help 5.6 RPM to 5.8 source

2008-05-19 Thread Dr.Ruud
Bob Cohen schreef: > It's just > that I'm getting hammered with spam and spamassassin and amavisd-new > seem to want a newer version of perl for some of the necessary and > optional perl modules. :-( Otherwise, I'd happily like the old > version. Why don't you put that functionality on a box of