[lopsa-tech] A PERL question

2013-12-20 Thread john boris
I have this perl script that I have a long if/elsif portion. I am porting a shell script to perl so I am trying to mimic a case statement from a shell script. I know I should use Switch but the version of PERL I am using (a bit old) and have to stay at the version does not have the switch.pm in cpa

Re: [lopsa-tech] A PERL question

2013-12-20 Thread Brandon Allbery
On Fri, Dec 20, 2013 at 10:39 AM, john boris wrote: > I have this perl script that I have a long if/elsif portion. I am porting > a shell script to perl so I am trying to mimic a case statement from a > shell script. I know I should use Switch but the version > Actually Switch is considered rath

Re: [lopsa-tech] A PERL question

2013-12-20 Thread M^2
Try eq instead of == (you want string, not numeric comparison) On Fri, Dec 20, 2013 at 10:39 AM, john boris wrote: > I have this perl script that I have a long if/elsif portion. I am porting > a shell script to perl so I am trying to mimic a case statement from a > shell script. I know I shoul

Re: [lopsa-tech] A PERL question

2013-12-20 Thread john boris
Okay. I added the missing semicolon and no change. I will go the hash route. The shell script that runs this passes the variable to the PERL script. Thanks for all the quick replies. On Fri, Dec 20, 2013 at 10:54 AM, Michael Tiernan wrote: > I'm *NOT* good at this so I'll just pose a couple of

Re: [lopsa-tech] A PERL question

2013-12-20 Thread Lance A. Brown
On 2013-12-20 10:45 am, Brandon Allbery wrote: Actually Switch is considered rather bad. #Okay lets setup the school variable #For sanity lets make sure we got the correct variable from the script print "$ARGV[0]n";  #this prints the correct variable if  ($ARGV[0] == "rc") {$school = "rc"} #Thi

Re: [lopsa-tech] A PERL question

2013-12-20 Thread Theo Van Dinter
+1, though I assume there'd be a check to make sure the values are actually valid? Presumably that's why there's a if/elsif tree of values it's expecting. I didn't see a final "else" for handling all other unexpected values, so maybe that wasn't being checked, but then you'd have a problem where

Re: [lopsa-tech] A PERL question

2013-12-20 Thread Dan Ritter
On Fri, Dec 20, 2013 at 11:05:46AM -0500, Lance A. Brown wrote: > On 2013-12-20 10:45 am, Brandon Allbery wrote: > >Actually Switch is considered rather bad. > > > >>#Okay lets setup the school variable > >>#For sanity lets make sure we got the correct variable from the > >>script > >>print "$ARGV[

Re: [lopsa-tech] A PERL question

2013-12-20 Thread john boris
Lance, The perl script is called like this from another shell script that does some worlk perl weekdays.pl $school Then in the perl script I am trying to print a long named based on the value of $school which ends up as $ARGV[0] in my perl script. What is giving me grief is that some of these ti

Re: [lopsa-tech] A PERL question

2013-12-20 Thread Brandon Allbery
On Fri, Dec 20, 2013 at 11:35 AM, john boris wrote: > The perl script is called like this from another shell script that does > some worlk > > perl weekdays.pl $school > Change this to perl weekdays.pl "$school" -- brandon s allbery kf8nh sine nomine associat

Re: [lopsa-tech] A PERL question

2013-12-20 Thread john boris
Brandon, You got it. That did it. Thanks to everyone for the quick response. What I did was this. In my shell script I changed the line which sets up the variable to this school= "\"Cardinal O\'Hara\"" And then when I called the perl script I did this (as Brandon suggested) perl weekdays.pl "$

Re: [lopsa-tech] A PERL question

2013-12-20 Thread Brandon Allbery
On Fri, Dec 20, 2013 at 11:50 AM, john boris wrote: > You got it. That did it. Thanks to everyone for the quick response. What I > did was this. > In my shell script I changed the line which sets up the variable to this > > school= "\"Cardinal O\'Hara\"" > This extra quoting shouldn't be necessa

Re: [lopsa-tech] A PERL question

2013-12-20 Thread Lance A. Brown
What is the shell script doing? I'd simplify things by incorporating it into the perl script. --[Lance] ___ Tech mailing list Tech@lists.lopsa.org https://lists.lopsa.org/cgi-bin/mailman/listinfo/tech This list provided by the League of Professional

Re: [lopsa-tech] A PERL question

2013-12-20 Thread john boris
Lance Yes incorporating everything in the perk script is the way to go but I am on a deadline. I have never programmed in PERL so I have been porting this over in pieces so I can get my boss off my back. Now that I have this portion done I can finish the project and finishing the total move to PERL

Re: [lopsa-tech] A PERL question

2013-12-20 Thread bergman
In the message dated: Fri, 20 Dec 2013 11:45:14 -0500, The pithy ruminations from Brandon Allbery on were: => On Fri, Dec 20, 2013 at 11:35 AM, john boris wrote: => => > The perl script is called like this from another shell script that does => > some worlk => > => > perl weekdays.pl $school

Re: [lopsa-tech] A PERL question

2013-12-20 Thread Charles Polisher
Dec 20, 2013 at 11:35:36AM -0500, john boris wrote: > Lance, > The perl script is called like this from another shell script that does > some worlk > > > perl weekdays.pl $school > > Then in the perl script I am trying to print a long named based on the > value of $school which ends up as $ARGV[

Re: [lopsa-tech] A PERL question

2013-12-20 Thread Brandon Allbery
On Fri, Dec 20, 2013 at 12:18 PM, wrote: > horrible, untested, pseudo-code follows ### > if ( $ARGV[$i] eq "-s" || $ARGV[$i] =~ /^--school$/ ) > Getopt::Long is a thing. Please use it instead of rolling your own. -- brandon s allbery kf8nh sin

Re: [lopsa-tech] A PERL question

2013-12-20 Thread john boris
I will do all of this as I bring more of the script over to PERL as this is my first move into writing PERL scripts so all of this advice and examples is greatly appreciated On Friday, December 20, 2013, Brandon Allbery wrote: > On Fri, Dec 20, 2013 at 12:18 PM, 'cvml', 'berg...@merctech.com');>

[lopsa-tech] experience w. "Advanced Clustering Technologies" as HPC vendor?

2013-12-20 Thread bergman
Does anyone have experience with "Advanced Clustering Technologies" as an HPC vendor? http://www.advancedclustering.com/ Thanks, Mark ___ Tech mailing list Tech@lists.lopsa.org https://lists.lopsa.org/cgi-bin/mailman/listinfo/tech This list pr

Re: [lopsa-tech] experience w. "Advanced Clustering Technologies" as HPC vendor?

2013-12-20 Thread Skylar Thompson
On 12/20/2013 02:40 PM, berg...@merctech.com wrote: > > Does anyone have experience with "Advanced Clustering Technologies" > as an HPC vendor? > > http://www.advancedclustering.com/ I've never bought their hardware, but their online HPL tool is pretty useful for getting a first-pass HPL.d