RE: configure a switch via ssh with a perl program

2016-07-13 Thread Taylor, Trac
July 12, 2016 7:33 PM To: beginners@perl.org Subject: Re: configure a switch via ssh with a perl program Shekar writes: > Hi Lee, > > If you can login to your switch via ssh, run required commands on the > switch and exit out, you should be able to simulate the same via > Ne

Re: configure a switch via ssh with a perl program

2016-07-12 Thread lee
Shekar writes: > Hi Lee, > > If you can login to your switch via ssh, run required commands on the > switch and exit out, you should be able to simulate the same via > Net::OpenSSH or Net::SSH::Perl Yes, that's what I was thinking. Only it takes time to program, that&

Re: configure a switch via ssh with a perl program

2016-07-04 Thread Shekar
Hi Lee, If you can login to your switch via ssh, run required commands on the switch and exit out, you should be able to simulate the same via Net::OpenSSH or Net::SSH::Perl Cheers, Shekar On Mon, Jul 4, 2016 at 8:18 PM, lee wrote: > Shlomi Fish writes: > > > Hi lee, > >

Re: configure a switch via ssh with a perl program

2016-07-04 Thread lee
Shlomi Fish writes: > Hi lee, > > On Mon, 04 Jul 2016 04:18:22 +0200 > lee wrote: > >> Hi, >> >> would it be possible to use something like Net::SSH::Perl to >> automatically alter the configuration of a switch into which I can log >> in manuall

Re: configure a switch via ssh with a perl program

2016-07-04 Thread Shlomi Fish
Hi lee, On Mon, 04 Jul 2016 04:18:22 +0200 lee wrote: > Hi, > > would it be possible to use something like Net::SSH::Perl to > automatically alter the configuration of a switch into which I can log > in manually via ssh? [SNIPPED] > Once per hour or so, the connections could

configure a switch via ssh with a perl program

2016-07-03 Thread lee
Hi, would it be possible to use something like Net::SSH::Perl to automatically alter the configuration of a switch into which I can log in manually via ssh? I'm looking for a way to automatically switch a network connection between two others. Since there don't seem to be any switche

Re: -e switch is not working on Window 7 and 8

2014-07-21 Thread Purvee Vora
Thanks Wolf. It is working now. cheers, Purvee On Mon, Jul 21, 2014 at 11:07 AM, WFB wrote: > Hi Purvee, > > perl -e 'xyz' works fine on Unix, however on Windows you must use " > instead. > > perl -e "print qq(Hello \n)" > > greetings, > wolf > > > On 21 July 2014 07:24, Purvee Vora wrote: >

Re: -e switch is not working on Window 7 and 8

2014-07-20 Thread Shaji Kalidasan
Dear Purvee, Here is one way to do it #Approach 1 [code] perl -e "print qq{Hello\n}" [/code] [output] Hello [/output] Please note: qq stands for double quotes #Approach 2 [code] perl -e "print 'Hello'" [/code] [output] Hello [/output] On Mon, Jul 21, 2014 at 10:54 AM, Purvee Vora wrote

Re: -e switch is not working on Window 7 and 8

2014-07-20 Thread WFB
Hi Purvee, perl -e 'xyz' works fine on Unix, however on Windows you must use " instead. perl -e "print qq(Hello \n)" greetings, wolf On 21 July 2014 07:24, Purvee Vora wrote: > Hi All, > > I am currently learing perl and was trying command line switches but It is > not working in window7 and

-e switch is not working on Window 7 and 8

2014-07-20 Thread Purvee Vora
Hi All, I am currently learing perl and was trying command line switches but It is not working in window7 and 8. Can any one help me out about this. I am really stuck here. I tried following example: perl -e 'print "Hello \n";' Commnad line shows blank response. I cannot see "Hello" world on

Re: Insecure $ENV{PATH} while running with -T switch at /usr/local/share/perl5/MIME/Lite.pm

2010-08-19 Thread Jim Gibson
whether my code is > causing this exception or the underlying MIME::Lite::TT::HTML or > MIME::Lite. > > Insecure $ENV{PATH} while running with -T switch at > /usr/local/share/perl5/MIME/Lite.pm line 2689., referer: > http://192.168.0.88/cgi-bin/dashboard.cgi > (Program sn

Insecure $ENV{PATH} while running with -T switch at /usr/local/share/perl5/MIME/Lite.pm

2010-08-19 Thread Mimi Cafe
::Lite. Insecure $ENV{PATH} while running with -T switch at /usr/local/share/perl5/MIME/Lite.pm line 2689., referer: http://192.168.0.88/cgi-bin/dashboard.cgi In my mobile I have this sub for sending mail and it has always worked until I switched on the -T. sub sendmail { my (%params

Re: Key classification using Switch

2009-07-21 Thread Steve Bertrand
Steve Bertrand wrote: > Uri Guttman wrote: >>> "SB" == Steve Bertrand writes: > >> i told you dispatch tables are very useful! >> >> i leave how to code it as an exercise for you. > > Well, I did end up implementing the dispatch table, and had some serious > problems trying to retrofit it in

Re: Key classification using Switch

2009-07-21 Thread Steve Bertrand
Uri Guttman wrote: >> "SB" == Steve Bertrand writes: > > i told you dispatch tables are very useful! > > i leave how to code it as an exercise for you. Well, I did end up implementing the dispatch table, and had some serious problems trying to retrofit it into a particular class's namespac

Re: Key classification using Switch

2009-07-21 Thread Steve Bertrand
atch table' containing all keys, eliminating duplicates - wrote a small sub named after each type classification that performs the sanity check - manually inserted the appropriate coderef as a value to each known key in the dispatch table - no API changes were necessary. I simply replaced the swit

Re: Key classification using Switch

2009-07-21 Thread Uri Guttman
> "SB" == Steve Bertrand writes: SB> # STRINGS SB> case /^(comment|plan_type|description|desc|started| SB> billing_address1|billing_address2|shipping_address1| SB> shipping_address2|billing_company_name|shipping_company_name| SB> shipping_town|billing_town)$/

Re: Key classification using Switch

2009-07-21 Thread John W. Krahn
Steve Bertrand wrote: I'm currently working on a field value validation system. It takes in a custom data type, and then runs each key through a switch statement and validates the value. As I add new data types, I run the type through the switch, to ensure all fields are tested. When the

Key classification using Switch

2009-07-21 Thread Steve Bertrand
I'm currently working on a field value validation system. It takes in a custom data type, and then runs each key through a switch statement and validates the value. As I add new data types, I run the type through the switch, to ensure all fields are tested. When they are not, I classify

Re: -T switch or tainted ?

2008-09-19 Thread Jack Gates
After getting some sleep (definitely the smartest thing I did) and (then looking at your code sample again) On Thursday 18 September 2008 04:28:07 am Dr.Ruud wrote: > > my $oldfile = $ARGV[0]; After I adjusted the RE content /^([ in here ]+)$/ >   my ($oldfile) = $ARGV[0] =~ /^([a-z]+)$/; >   di

Re: -T switch or tainted ?

2008-09-18 Thread Raymond Wan
? perlsec did not help me at all. My script works when I take the -T switch out my $oldfile = $ARGV[0]; # line 22 my $newfile = $ARGV[1]; # line 23 open(OF, $oldfile); # line 25 open(NF, ">$newfile"); # line 26 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additio

Re: -T switch or tainted ?

2008-09-18 Thread Dr.Ruud
Jack Gates schreef: > my $oldfile = $ARGV[0]; my ($oldfile) = $ARGV[0] =~ /^([a-z]+)$/; die "bad old filename" unless $oldfile; > my $newfile = $ARGV[1]; my ($newfile) = $ARGV[1] =~ /^([a-z]+)$/; die "bad new filename" unless $newfile; > open(OF, $oldfile) open my $OF, "<", $ol

-T switch or tainted ?

2008-09-18 Thread Jack Gates
Okay now I have a question because I can't find an answer. The Perl documentation does not answer my question and I can't find an answer using Google. At the top of my script I have: #!/usr/bin/perl -T use strict; use warnings; use diagnostics -verbose; When I put the -T switch in

Re: reg:script to check that all switch statements have the "default" case

2008-03-15 Thread Chas. Owens
On Sat, Mar 15, 2008 at 4:50 AM, Gowri Chandra Sekhar Barla, TLS, Chennai <[EMAIL PROTECTED]> wrote: > > > Hi > > Please help me in writing the script to check that all switch statements > have the "default" case in a file > > Thanks and regards >

reg:script to check that all switch statements have the "default" case

2008-03-15 Thread Gowri Chandra Sekhar Barla, TLS, Chennai
Hi Please help me in writing the script to check that all switch statements have the "default" case in a file Thanks and regards Chandu DISCLAIMER: --- The contents

Re: order of command line switch?

2008-02-13 Thread Chas. Owens
On Feb 13, 2008 2:57 PM, ciwei <[EMAIL PROTECTED]> wrote: snip > so why the order of -n -e switch make the differience? > this is perl 5.8.4. > Thanks snip This is true in all versions of Perl. It is becuase you are allowed to have more than one -e option: perl -e 'print

Re: order of command line switch?

2008-02-13 Thread Kashif Salman
le > > hostA>ls | perl -ne 'print if /SUNW/' > SUNWits > SUNWjass > SUNWmlib > SUNWrtvc > > so why the order of -n -e switch make the differience? > this is perl 5.8.4. > Thanks > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For ad

order of command line switch?

2008-02-13 Thread ciwei
hostA>ls SUNWjassVRTSVRTSicsco VRTSvcs emc SUNWmlibVRTSalloc VRTSjre VRTSvlicVRTSvxvm hostA>ls | perl -en 'print if /SUNW/' return nothing , while hostA>ls | perl -ne 'print if /SUNW/' SUNWits SUNWjass SUNWmlib SUNWrtvc so w

Re: Multiple character command line switch

2007-03-12 Thread yitzle
You can access the command line parameters directly without any module with @ARGV. Not sure if this helps. myScript -f1 -f2 Something like this might work: for ( $i = 0; $i < [EMAIL PROTECTED] - 1; $i += 2 ) { hash{"AGV[$i]"} = AGV[$i + 1]; } print "FIle 1: $hash{'-f'}"; On 3/13/07, brajesh

Re: Multiple character command line switch

2007-03-12 Thread Jeff Pang
> >Hi all, > >I was trying to write a script. I wanted to use multiple characters in >command line switches. >For example >myScript -f1 -f2 > >now getopt or getopts allows only for single character switches (please >correct me if its not true). >Is there any module which will allow my to have mu

Multiple character command line switch

2007-03-12 Thread brajesh agrawal
Hi all, I was trying to write a script. I wanted to use multiple characters in command line switches. For example myScript -f1 -f2 now getopt or getopts allows only for single character switches (please correct me if its not true). Is there any module which will allow my to have multiple chara

Re: Record separator and regex switch

2007-02-26 Thread Beginner
On 26 Feb 2007 at 18:13, D. Bolliger wrote: > Beginner am Montag, 26. Februar 2007 17:02: > > On 26 Feb 2007 at 15:58, D. Bolliger wrote: > > > Beginner am Montag, 26. Februar 2007 14:50: > > Hi > > > > > I am trying to parse some dhcp-lease files to extract the ip, mac and > > > > hostname. ..s

Re: Record separator and regex switch

2007-02-26 Thread D. Bolliger
Beginner am Montag, 26. Februar 2007 17:02: > On 26 Feb 2007 at 15:58, D. Bolliger wrote: > > Beginner am Montag, 26. Februar 2007 14:50: Hi > > > I am trying to parse some dhcp-lease files to extract the ip, mac and > > > hostname. > > > > > > I am struggling to get either, the regex of the $/,

Re: Record separator and regex switch

2007-02-26 Thread John W. Krahn
Beginner wrote: > On 26 Feb 2007 at 15:58, D. Bolliger wrote: >> >>#!/usr/bin/perl >> >>use strict; >>use warnings; >> >>{ >> local $/="}\n"; >> for () { >>my ($ip,$mac,$host)= >> /lease\s+(\S+).* >>ethernet\s+(\S+);.* >>hostname\s+(\S+); >> /sx; >>print "I

Re: Record separator and regex switch

2007-02-26 Thread Beginner
On 26 Feb 2007 at 15:58, D. Bolliger wrote: > Beginner am Montag, 26. Februar 2007 14:50: > > Hi, > > Hi > > > I am trying to parse some dhcp-lease files to extract the ip, mac and > > hostname. > > > > I am struggling to get either, the regex of the $/, correct. I am not > > sure which combinat

Re: Record separator and regex switch

2007-02-26 Thread D. Bolliger
Beginner am Montag, 26. Februar 2007 14:50: > Hi, Hi > I am trying to parse some dhcp-lease files to extract the ip, mac and > hostname. > > I am struggling to get either, the regex of the $/, correct. I am not > sure which combination of these I should use. > > There is some sample data and my b

Record separator and regex switch

2007-02-26 Thread Beginner
Hi, I am trying to parse some dhcp-lease files to extract the ip, mac and hostname. I am struggling to get either, the regex of the $/, correct. I am not sure which combination of these I should use. There is some sample data and my best effort below. Can anyone offer any pointers? TIA, Dp.

Re: Switch, Ranges and Memory

2006-08-29 Thread John W. Krahn
4), does it take up the > same amount of memory as if I actually entered all those in between > numbers? Yes. > I'm asking because I want to use ranges in a switch statement and they > are large ranges like the above. I don't think I can use >= in the case > section of the

Re: Switch, Ranges and Memory

2006-08-29 Thread Tom Phoenix
On 8/29/06, Barron Snyder (CE CEN) <[EMAIL PROTECTED]> wrote: For example, if I create a list like (123..456754), does it take up the same amount of memory as if I actually entered all those in between numbers? Generally, yes. I'm asking because I want to use ranges in a switc

Switch, Ranges and Memory

2006-08-29 Thread Barron Snyder \(CE CEN\)
When using the range operator, is the list actually created with all the elements? For example, if I create a list like (123..456754), does it take up the same amount of memory as if I actually entered all those in between numbers? I'm asking because I want to use ranges in a switch stat

Re: User define switch

2006-02-20 Thread Matt Johnson
Andrej Kastrin wrote: > Dear all, > > Is there any simple way to add user defined switches in Perl. I want > someting like that: > > perl --filein MyInputFileName --fileout MyOutputFileName ##in command line > > With --filein switch I want to define file, which will be

User define switch

2006-02-20 Thread Andrej Kastrin
Dear all, Is there any simple way to add user defined switches in Perl. I want someting like that: perl --filein MyInputFileName --fileout MyOutputFileName ##in command line With --filein switch I want to define file, which will be read as the input and with the --fileout the output file

Re: -w switch not working

2006-02-03 Thread Wijnand Wiersma
I do use warnings; in all my scripts, in case the shebang isn't used. That doesn't seem to be the problem though, maybe you should have some code that actually produces warnings? Wijnand -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: -w switch not working

2006-02-03 Thread Chris Devers
On Thu, 2 Feb 2006, Elliot Holden wrote: > This is what I am typing at the Terminal prompt: > > perl -w first.cgi > > first.cgi being the name of my file. What output, if any, are you getting? It seems to work fine here: $ perl -c first.cgi first.cgi syntax OK $ perl -w first.cgi

-w switch not working

2006-02-03 Thread Elliot Holden
s Web Warrior Series). This is the script below: #!/usr/bin/perl #first.cgi - my first CGI script print "Content-type: text/html\n\n"; #generate HTML print "\n"; print "First Script\n"; print "Congratulationss\n"; print "\n"; okay, when I use the -c

RE: select case or switch statement

2005-06-12 Thread Charles K. Clarkson
Omega -1911 wrote: : I am still trying to grasp using case statements... Since I am : new to this, I had a question as to the speed of using CASE. I : currently have a script that has 91 if/elsif/else statements in : total. Will switching to using CASE improve the execut

Re: select case or switch statement

2005-06-12 Thread Omega -1911
AIL PROTECTED]> wrote: > On Sat, 11 Jun 2005, Jeff 'japhy' Pinyan wrote: > > > On Jun 11, Ron Smith said: > > > > > Does Perl have the equivalent of a case statement or a switch > > > statement. I'm trying to avoid a bunch of "if-then&quo

Re: select case or switch statement

2005-06-11 Thread Chris Devers
On Sat, 11 Jun 2005, Jeff 'japhy' Pinyan wrote: > On Jun 11, Ron Smith said: > > > Does Perl have the equivalent of a case statement or a switch > > statement. I'm trying to avoid a bunch of "if-then" statements. > > I'm seeing posts regardin

Re: select case or switch statement

2005-06-11 Thread Jeff 'japhy' Pinyan
On Jun 11, Ron Smith said: Does Perl have the equivalent of a case statement or a switch statement. I'm trying to avoid a bunch of "if-then" statements. I'm seeing posts regarding "use switch", but I want to make sure it's not a deprecated practice. I

Re: select case or switch statement

2005-06-11 Thread Ron Smith
I used 'perldoc -f switch' and nothing came up. I've done what you suggested and I'm on my way. Thank you very much. R "Ing. Branislav Gerzo" <[EMAIL PROTECTED]> wrote: Ron Smith [RS], on Saturday, June 11, 2005 at 14:11 (-0700 (PDT)) has on mind: RS>

Re: select case or switch statement

2005-06-11 Thread Ing. Branislav Gerzo
Ron Smith [RS], on Saturday, June 11, 2005 at 14:11 (-0700 (PDT)) has on mind: RS> Does Perl have the equivalent of a case statement or a switch RS> statement. I'm trying to avoid a bunch of "if-then" statements. RS> I'm seeing posts regarding "use switch",

select case or switch statement

2005-06-11 Thread Ron Smith
Does Perl have the equivalent of a case statement or a switch statement. I'm trying to avoid a bunch of "if-then" statements. I'm seeing posts regarding "use switch", but I want to make sure it's not a deprecated practice. I'm using Perl -v 5.8.0. my

Re: last question on the switch statement ....

2005-04-18 Thread John W. Krahn
David Gilden wrote: Dear fellow PERL coders..., Hello, What is the "&& do" part of the code doing, i.e. I am looking to understand the syntax, the example was found in perl beginners archive, from some else's post... && is the logical 'and' operator. If the expression on its left is evaluated as

Re: last question on the switch statement ....

2005-04-18 Thread Vladimir D Belousov
wrote: Dear fellow PERL coders..., What is the "&& do" part of the code doing, i.e. I am looking to understand the syntax, the example was found in perl beginners archive, from some else's post... Thanks, Dave (kora musician / audiophile / webmaster @ www.coraconnection

last question on the switch statement ....

2005-04-17 Thread David Gilden
/ Ft. Worth, TX, USA) foreach (@qString) { if ($_ =~ m/open/) { SWITCH: { $_ eq 'Unkopen' && do { next; last SWITCH; }; $_ eq 'QCSSopen' && do { $rep = "Quest Central for SQL Server"; last SWITCH; }; $_ eq 'QCSS

Re: Preventing CPU spikes / was switch confusion

2005-04-13 Thread Offer Kaye
On 4/14/05, David Gilden wrote: > use strict; Where is "use warnings;" ? It seems to be missing ;-) > use switch; Shouldn't that be "use Switch;" (with a capital "S")? Read "perldoc Switch", the usage syntax is well documented there. -- Offe

RE: Preventing CPU spikes / was switch confusion

2005-04-13 Thread David Gilden
Dear Perl Gurus, I have some problems that I think are a result of how my Switch statement is written. This script is invoked via a web browser to upload a file, and do a few other things. However it appears that the user system / network, or my script is stalling. So the user clicks the

RE: Switch -- confused

2005-04-13 Thread David Gilden
Greetings, Thanks for the help so far, I am added switch... but not sure that I have syntax correct Maybe this is best written as if else logic and or: my $action = $q->param( "action" ); SWITCH ($action) { if (/Upload/) { last SWITCH;

Re: Does the SWITCH statement have a default?

2005-01-20 Thread Josimar Nunes de Oliveira
Hello everybody, see the documentation at: http://cpan.uwinnipeg.ca/htdocs/Switch/Switch.html and try the example below: use Switch; $op = 1; while ($op > 0){ chomp( $op = ); switch ($op) { case 1 { print "\n One" } case 3 { print "\n Three" }

Re: Does the SWITCH statement have a default?

2005-01-20 Thread Peter_Farrar
>Is there a correct way to define a default case within a SWITCH? I tried with >the bottom case, but that errors with: >Quantifier follows nothing before HERE mark in regex m/* << HERE / at ./ctest line 251. >SWITCH: >{ > $field =~ /^CR\d{0,7}$/ && d

Does the SWITCH statement have a default?

2005-01-20 Thread Paul Ohashi
Hi, Is there a correct way to define a default case within a SWITCH? I tried with the bottom case, but that errors with: Quantifier follows nothing before HERE mark in regex m/* << HERE / at ./ctest line 251. SWITCH: { $field =~ /^CR\d{0,7}$/ && do {

Re: built-in switch statement?

2004-12-06 Thread Jonathan Paton
Hi, Larry Wall mentions this in the Apocalypse 4 document for Perl 6: "Another argument against having a switch statement in Perl 6 is that we never had it in the first five versions of Perl. But it would be incorrect to say that we didn't miss it. What actually happened was that

built-in switch statement?

2004-12-06 Thread pablo wablo
I'm just wondering what is the reason that switch is not built-in in perl... I can do a switch statement by using the Switch module, but I'm wondering why it's not already builtin with the interpreter. thanks __ Do You Yahoo!

Re: A force switch with MCPAN install

2004-11-25 Thread John Pretti
- Original Message - From: "Michael David" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, November 25, 2004 10:41 PM Subject: A force switch with MCPAN install Hello, I am trying to install the DBD::mysql package, but I am having some issues with

A force switch with MCPAN install

2004-11-25 Thread Michael David
push through make testing If this is too much to ask, just finding out the switch for force would do, I can't seem to find any doco on this. perl -MCPAN -e 'install DBD::mysql' mike

Re: Perl script to switch user to root.

2004-03-05 Thread WC -Sx- Jones
David le Blanc wrote: SUID scripts are not secure. Modern OS's disable them. True; but it is difficult to ask for a firecracker when all you can use is a stick of dynamite... Besides, I forget, was the OP on MacOS? IMHO it is best to see if root MUST be the only recourse. Maybe alternatives we

RE: Perl script to switch user to root.

2004-03-05 Thread David le Blanc
> -Original Message- > From: WC -Sx- Jones [mailto:[EMAIL PROTECTED] > Sent: Friday, 5 March 2004 5:13 AM > To: Silky Manwani > Cc: [EMAIL PROTECTED] > Subject: Re: Perl script to switch user to root. > > Silky Manwani wrote: > > Hello, > > > &g

RE: [Perl-beginners] Perl script to switch user to root.

2004-03-04 Thread Remko Lodder
pt to switch user to root. Actually, My program has a list of stuff to be done which needs to be done as say user "x". Then I need to switch user to root as the rest of the program needs to do stuff as user root. so, me doing system("sudo su root"); doesn't help as it ask

Re: [Perl-beginners] Perl script to switch user to root.

2004-03-04 Thread Silky Manwani
Actually, My program has a list of stuff to be done which needs to be done as say user "x". Then I need to switch user to root as the rest of the program needs to do stuff as user root. so, me doing system("sudo su root"); doesn't help as it asks for the password. On

Re: Perl script to switch user to root.

2004-03-04 Thread WC -Sx- Jones
Silky Manwani wrote: Hello, I want to write a perl script to switch user (to root). The problem is that since it asks for the password, I am not sure how I would pass it thru the script. I know I can run the "su root" with the system command in perl, but how do I take care of p

RE: [Perl-beginners] Perl script to switch user to root.

2004-03-04 Thread Remko Lodder
switch user to root. Hello, I want to write a perl script to switch user (to root). The problem is that since it asks for the password, I am not sure how I would pass it thru the script. I know I can run the "su root" with the system command in perl, but how do I take care of p

Perl script to switch user to root.

2004-03-04 Thread Silky Manwani
Hello, I want to write a perl script to switch user (to root). The problem is that since it asks for the password, I am not sure how I would pass it thru the script. I know I can run the "su root" with the system command in perl, but how do I take care of passing the password. Than

Re: switch statement

2004-02-19 Thread WilliamGunther
I just benchmarked Filter, and it was worse than 100 times slower In a message dated 2/19/2004 6:53:56 PM Eastern Standard Time, [EMAIL PROTECTED] writes: last time i benchmark a source filter, it's about 100 times slower. has that change since v5.8? -Will ---

Re: switch statement

2004-02-19 Thread John W. Krahn
Anthony Vanelverdinghe wrote: > > Hi Hello, > Could anyone please tell me what's wrong with the following "program"? > The compiler gives errors in the switch statement. > > %commands=('v',0,'w',1,'t',2,'/pattern/&

Re: switch statement

2004-02-19 Thread david
Rob Dixon wrote: > <[EMAIL PROTECTED]> wrote: >> >> The Advantage is you get to use the switch statement. The disadvantage is >> your code will run extraordinarily slow because the Switch module uses a >> run time Filter. In short: isn't an is-elsif-else

Re: switch statement

2004-02-19 Thread James Edward Gray II
On Feb 19, 2004, at 5:21 PM, Paul Johnson wrote: The problem is that Switch.pm is a source filter, which is effectively an extra level of processing before compilation. Personally, I wouldn't use a source filter for anything I cared about. The docs for Switch state: There are undoub

Re: switch statement

2004-02-19 Thread Paul Johnson
On Thu, Feb 19, 2004 at 10:46:33PM -, Rob Dixon wrote: > <[EMAIL PROTECTED]> wrote: > > > > The Advantage is you get to use the switch statement. The disadvantage is > > your code will run extraordinarily slow because the Switch module uses a run time > > Fi

Re: switch statement

2004-02-19 Thread WilliamGunther
This: if ($op == 0) {} elsif ($op == 1) {} elsif ($op == 2) {} elsif ($op == 3) {} elsif ($op == 4) {} elsif ($op == 5) {} is faster than this: use Switch; switch ($op) { case 0 { last } case 1 { last } case 2 { last } case 3 { last } case 4 { last } case 5 { last

Re: switch statement

2004-02-19 Thread Rob Dixon
<[EMAIL PROTECTED]> wrote: > > The Advantage is you get to use the switch statement. The disadvantage is > your code will run extraordinarily slow because the Switch module uses a run time > Filter. In short: isn't an is-elsif-else statement enough?? Are you saying th

Re: switch statement

2004-02-19 Thread u235sentinel
te: > > > Hi > > Howdy. > > > Could anyone please tell me what's wrong with the following "program"? > > I'll try. > > > The compiler gives errors in the switch statement. > > Perl doesn't have a native switch statement, b

Re: switch statement

2004-02-19 Thread WilliamGunther
The Advantage is you get to use the switch statement. The disadvantage is your code will run extraordinarily slow because the Switch module uses a run time Filter. In short: isn't an is-elsif-else statement enough?? In a message dated 2/19/2004 4:40:56 PM Eastern Standard Time, [EMAIL PROT

Re: switch statement

2004-02-19 Thread Daniel Staal
--As of Thursday, February 19, 2004 10:29 PM +0100, Anthony Vanelverdinghe is alleged to have said: Didn't know it wasn't in Perl, but I've just discovered it's possible with some file called "Switch.pm" --As for the rest, it is mine. You mean the 'Swi

Re: switch statement

2004-02-19 Thread James Edward Gray II
On Feb 19, 2004, at 3:14 PM, Anthony Vanelverdinghe wrote: Hi Howdy. Could anyone please tell me what's wrong with the following "program"? I'll try. The compiler gives errors in the switch statement. Perl doesn't have a native switch statement, but it is included

Re: switch statement

2004-02-19 Thread Anthony Vanelverdinghe
Didn't know it wasn't in Perl, but I've just discovered it's possible with some file called "Switch.pm" From: Daniel Staal <[EMAIL PROTECTED]> Reply-To: Perl Beginners <[EMAIL PROTECTED]> To: Perl Beginners <[EMAIL PROTECTED]> Subject: Re: switch

Re: switch statement

2004-02-19 Thread Daniel Staal
--As of Thursday, February 19, 2004 10:14 PM +0100, Anthony Vanelverdinghe is alleged to have said: Could anyone please tell me what's wrong with the following "program"? The compiler gives errors in the switch statement. --As for the rest, it is mine. You mean, besides the

switch statement

2004-02-19 Thread Anthony Vanelverdinghe
Hi Could anyone please tell me what's wrong with the following "program"? The compiler gives errors in the switch statement. Thx!! Anthony %commands=('v',0,'w',1,'t',2,'/pattern/',3,'s',4,'x',5); $end = 0; while (!end

RE: Trouble with -T switch

2004-02-10 Thread Marcus Willemsen
Thanks Jan, It worked. > $ENV{'PATH'} = ""; > open (SENDMAIL, "|/usr/sbin/sendmail -oi -t -odq"); > Are you aware of [EMAIL PROTECTED] I posted my CGI > questions to [EMAIL PROTECTED] until someone notified me of > this list. Yes, I am. And I don't know why I didn't post my question there. But

RE: Trouble with -T switch

2004-02-09 Thread Jan Eden
Hi Marcus, Marcus Willemsen wrote: >>>Hi everybody, >>> >>>I'm having trouble with setting the path to my sendmail program >>>when using the -T switch. >>>Here is a part of the code >> > snippet__ >> &

RE: Trouble with -T switch

2004-02-09 Thread Wiggins d Anconia
> > > Hi everybody, > > > > > > I'm having trouble with setting the path to my sendmail program when > > using the -T switch. It's a simple script that creates a > > from, asks for an email adresse and sends an answer after the > >

RE: Trouble with -T switch

2004-02-09 Thread Marcus Willemsen
> > Hi everybody, > > > > I'm having trouble with setting the path to my sendmail program when > using the -T switch. It's a simple script that creates a > from, asks for an email adresse and sends an answer after the > form was submitted. I keep getting th

Re: Trouble with -T switch

2004-02-09 Thread Wiggins d Anconia
> Hi everybody, > > I'm having trouble with setting the path to my sendmail program when using the -T switch. It's a simple script that creates a from, asks for an email adresse and sends an answer after the form was submitted. I keep getting the following error message althoug

Trouble with -T switch

2004-02-09 Thread Marcus Willemsen
Hi everybody, I'm having trouble with setting the path to my sendmail program when using the -T switch. It's a simple script that creates a from, asks for an email adresse and sends an answer after the form was submitted. I keep getting the following error message although I'

Re: switch user

2003-06-16 Thread Ahmed Moustafa
Steve Grazzini wrote: Ahmed Moustafa <[EMAIL PROTECTED]> wrote: [ That address is bouncing, by the way. ] It should not! What was the message that you got? How can I switch user "su" in perl? It's much easier to do that before running the script. :-) $ su -c ./scr

Re: switch user

2003-06-16 Thread Steve Grazzini
Ahmed Moustafa <[EMAIL PROTECTED]> wrote: [ That address is bouncing, by the way. ] > How can I switch user "su" in perl? It's much easier to do that before running the script. :-) $ su -c ./script.pl And then once you're root, you can change the real and effe

switch user

2003-06-16 Thread Ahmed Moustafa
How can I switch user "su" in perl? Thanks in advance, Ahmed -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Help with -e switch

2002-12-24 Thread RMD
OTECTED]> Cc: "Perl Beginners" <[EMAIL PROTECTED]> Sent: Tuesday, December 24, 2002 12:17 PM Subject: Re: Help with -e switch > On Tue, Dec 24, 2002 at 08:38:35AM +1100, Kieren Diment wrote: > > > I'd like to know if it's possible to combine the -i and -e switch

Re: Help with -e switch

2002-12-24 Thread Paul Johnson
On Tue, Dec 24, 2002 at 08:38:35AM +1100, Kieren Diment wrote: > I'd like to know if it's possible to combine the -i and -e switches. > I have the following script, and I'd like not to have to go to the > bother of firing up an editor, chmod +x ing it and co: > > #!/usr/bin/perl -w > open FILE, $

RE: Help with -e switch

2002-12-24 Thread wiggins
Should work according to the examples in perldoc perlrun Search for the -i. http://danconia.org On Tue, 24 Dec 2002 08:38:35 +1100, Kieren Diment <[EMAIL PROTECTED]> wrote: > I'd like to know if it's possible to combine the -i and -e switches

Help with -e switch

2002-12-24 Thread Kieren Diment
I'd like to know if it's possible to combine the -i and -e switches. I have the following script, and I'd like not to have to go to the bother of firing up an editor, chmod +x ing it and co: #!/usr/bin/perl -w open FILE, $ARGV[0]; while () { print if (/(^org_name)|(^email)|(^$)/);

Re: The basics of SWITCH

2002-11-04 Thread Jeff 'japhy' Pinyan
On Nov 4, K Pfeiffer said: >Gajo Csaba writes: >> Hi, I have a problem with SWITCH. I wrote this, I think >> it's clear to anzone what it should do: > >Just out of curiousity I typed in 'perldoc SWITCH' and 'perldoc -f SWITCH' >and found nothi

Re: The basics of SWITCH

2002-11-04 Thread K Pfeiffer
Gajo Csaba writes: > Hi, I have a problem with SWITCH. I wrote this, I think > it's clear to anzone what it should do: Just out of curiousity I typed in 'perldoc SWITCH' and 'perldoc -f SWITCH' and found nothing. What is it? (the short answer is fine) Th

  1   2   >