Re: accessing chars in a string

2009-09-01 Thread Chuck Crisler
My immediate problem was checking a specific position in a string for a specific value (if the char in the first position == '#', skip the record). substr works OK in that case. However, I also want to learn more and it seems regex is a better and more powerful answer. Thank you, Chu

Re: accessing chars in a string

2009-09-01 Thread Chuck Crisler
duh substr($str, 0, 1); On Tue, 2009-09-01 at 20:49 -0400, Chuck Crisler wrote: > How do I access specific character positions in a scalar string? In case > it makes any difference, I specifically want to test the zeroth > character. Something like the following. > > my $str = &q

accessing chars in a string

2009-09-01 Thread Chuck Crisler
How do I access specific character positions in a scalar string? In case it makes any difference, I specifically want to test the zeroth character. Something like the following. my $str = "abc"; if ($str[0] == '#') { do something... } Thank you in advance! Chuck -

Re: invoking perl from html

2009-07-16 Thread Chuck Crisler
One more piece of info. I am not using a form. I have an example from Apache for that. Chuck On Thu, 2009-07-16 at 20:48 -0400, Chuck Crisler wrote: > This isn't exactly on-topic, but maybe someone can help me with this > problem. I need to execute a Perl script on the server from

invoking perl from html

2009-07-16 Thread Chuck Crisler
nswer, but it would really be helpful to also know where to look for this information. :-) Thank you, Chuck -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Stupid newb question

2009-03-12 Thread Chuck Lyon
Hi, I thought: 'perl is pretty eclectic, and it's usually simpler than it looks'. Let's give it a try: The following does what you want from an AIX 5.3 (perl 5.8.2) command line perl -e'print system("ls -l")' These are quotes and apostrophes. No "backticks." On 3/11/09 2:36 PM, "neckha...

FW: New Build for AIX Fails in debugger

2009-03-10 Thread Chuck Lyon
Hello, I'm hoping someone can help me identify the problem I'm encountering with a new PERL built with gcc on an AIX box. (I'd also appreciate any help in redirecting the request, if appropriate - TIA) The symptoms are that the debugger doesn't seem to be able to find the source code of the main

Re: Perl fork() system call

2009-02-19 Thread Chuck
thanks for the help, everyone. We found a way that works...we used Win32::Process::Create. On Feb 18, 7:02 pm, chas.ow...@gmail.com (Chas. Owens) wrote: > On Wed, Feb 18, 2009 at 12:14, Chuck wrote: > > Hello, > > > We have a GUI where, if a button is clicked, Putty

Perl fork() system call

2009-02-18 Thread Chuck
Hello, We have a GUI where, if a button is clicked, Putty (the remote access program) is launched using System("C:\\Progra~1\\Putty\\putty.exe"); is launched. However, when this is executed, the original GUI freezes, and we cannot use it unless we close Putty. We tried using the fork() command l

Calling PHP web component from Perl

2009-02-18 Thread Chuck
te package, but haven't had any luck. Any help is appreciated. Thanks, Chuck -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

variable assignment

2005-11-11 Thread Charles (Chuck) Mattice
Hi All, I'm new to the list and know more php than perl. I can read perl and understand some of it. One problem I seem to be facing is variable assignment and keeping the variables from script to script. In php this is fairly easy by assigning the global to the variable. I'm not sure how to

Re: Delimiter for string..

2004-02-04 Thread Chuck Fox
. $param1."?) panic: realloc at mybly.pl line 263. regards, Ajitpal Singh, HTH, Chuck -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Newbie

2004-01-22 Thread Chuck Fox
tab labeled, File Types. More than likely, you will want to create a new association between .cgi and perl. HTH, Your Friendly Neighborhood DBA, Chuck -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Perl C module compile fails

2004-01-20 Thread Chuck Fox
es Forestieres La Tuque, P.Q. Tel.: (819) 676-8100 X2833 [EMAIL PROTECTED] HTH, Chuck -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: case and functions

2004-01-06 Thread Chuck Fox
they like. -- Terry Pratchett in Sourcery Have you checked into Switch.pm ? It provides a switch/case construct similar to a C switch. HTH, Chuck

Re: Term:ANSIColor and negative numbers

2003-12-19 Thread Chuck Fox
! Your Friendly Neighborhood DBA, Chuck -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Recommended simple Perl IDE/Editors ?

2003-12-15 Thread Chuck Fox
, mac, and *nix. HTH, Chuck -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: [OT] Education Level

2003-12-08 Thread Chuck Fox
I had one semester of college 20 years ago and normally classify myself as "finished high school". I'm curious: What level of education have list members attained? TEA, Charles K. Clarkson Took a college course in Basic back in 1980. Thats all the "higher" educati

Re: Beta Testing a Robot

2003-12-04 Thread Chuck Fox
, one may subscribe -- of this activity may also prove useful in the long run to the lurkers like myself. Thanks for the cool and interesting approach to getting an answer out to the questioner. Chuck [EMAIL PROTECTED] wrote: It was Wednesday, December 03, 2003 when Casey West took the soap box

Re: Rephrasing the Question

2003-11-18 Thread Chuck Fox
this technique. perl -pi -e's/Wuniq\(/hyd_uniq\(/' *.c Regards, Chuck - Jason /• • If A equals success, then the formula is: • X+Y+Z = A • X is work. Y is play. And Z is keep your mouth shut. • -Albert Einstein •/ -- To unsubscribe, e-mail: [EMAIL PROTECTED]

Re: Pivoting Data for use with gnuplot (solved)

2003-11-15 Thread Chuck Fox
Chuck Fox wrote: Fellow perl coders, I am having trouble wrapping my head around how to accomplish the following: Given a dbi result set that consists of datetime, servername, databasename, procedurename and average elapsed time. Convert this into an data structure suitable for export to a

Re: writing excel files

2003-11-14 Thread Chuck Fox
work with them. But for quick and dirty, this works fine. Regards, Chuck sub DoWork { my( $pServer, $pUser, $pPassword, $pStartDate, $pEndDate ) = @_; my( $Query ); my( $Count, $Error, @Rows ); my( $Line ); my( @Record ); my( $statementHandle ); my( $data ); my( $o

Re: Help with UNIX commands

2003-11-14 Thread Chuck Fox
right place to post this. Thanks. The following link shows a huge list of OS level tasks and the commands to run them on a slew of different (*nix), including our favorites Solaris, HPUX and Linux. http://bhami.com/rosetta.html Enjoy Chuck -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

Pivoting Data for use with gnuplot

2003-11-14 Thread Chuck Fox
I have been listening in. Chuck Fox -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Fw: question

2003-11-13 Thread Chuck Fox
my biggest complaints about PHP is its inability to retreive multiple results sets from a single call. Sybase stored procedures and PHP don't interact very well. But in Perl, just code the loop that the PHP command hides from you and voila, multiple result sets. Chuck

Re: Representing a Database as XML

2003-11-11 Thread Chuck Fox
ification, that is then exported with appropriate extensions for your target SQL platform. ERStudio also has a SAX basic interface that allows you to manipulate the db objects to your hearts content. Chuck

Re: Died on open command

2003-11-10 Thread Chuck Fox
WindowsXP box. I had to enclose the path in double quotes. But once I did that, Windows did the right thing, dir "\temp" dir "/temp" both give me the temp directory listing. Using single quotes or backticks does not work. Chuck

Re: RE : SQL Syntax quickie

2003-10-27 Thread Chuck Fox
Yet another solution SET ROWCOUNT 1 SELECT id FROM table ORDER BY id DESC Only works if there is an index on id and the RDBMS support backward scans Chuck [EMAIL PROTECTED] wrote: Another solution : For your query, try "SELECT MAX(id) FROM table" That works with mysql. -Message

Re: explicit vs implicit syntax

2003-10-02 Thread Chuck Fox
In other words - save it for Perl Golf ;-) HTH, Thomas PS: Perl Golf - writing code with as little (key-)strokes as possible. Thomas, Beyond all the enlightenment that this list brings, I am stunned (ROTFLMAO) to realize that coding could be a sport. Cya at the 19th hole. Chuck -- To

Re: avoid repitive code while sorting hash arrays

2003-09-19 Thread Chuck Fox
ever joined. Thanks to you and all the others that post to this forum. Chuck [EMAIL PROTECTED] wrote: Ramprasad wrote: suppose I have a hash like %users =( 'cvs' => { 'uname' => 'cvs', '

Re: How to secure database password? (was Re: Perl/DBI newbie: password storage / security question)

2003-09-17 Thread Chuck Fox
and would require our decryption module to make sense of it. Again, the point is that, "secure" has to be defined for your particular circumstances. If it makes more sense for you to use the OS to protect passwords, then that is your "best" solution. Good Luck, Chuck [EMAIL P

Re:

2003-09-16 Thread Chuck Fox
No matter how foolproof you make, the fools keep getting smarter. Chuck [EMAIL PROTECTED] wrote: Dan Anderson wrote: > > He is right. Although I am new to Perl, I have had some very dumb users > break my PHP scripts by inputting things like "eighteen dollars and 0 > cent

Re: Perl/DBI newbie: password storage / security question

2003-09-15 Thread Chuck Fox
we do not have web servers calling directly to dbs, so the issue of clear text password in the subclassed DBI module is not so much of a concern for us. Like most places there are 9 layers of security to get through before you can try to run perl code on a production host. HTH, Chuck Fox

Re: new to perl

2003-08-28 Thread Chuck Fox
Shirley, I do almost the exact same thing in my database dump script. Here is the function that I use to remove older dump files. HTH, Chuck Fox ### Prune Dumps Subroutine ### ### Description: ### This subroutine will

Re: Perl & XML

2003-08-28 Thread Chuck Fox
Joe, Try XML::Writer Chuck [EMAIL PROTECTED] wrote: I'm beginning my studies of XML and am looking for a Perl module(s) that allows me to be able to dynamically generate the XML along with any data and display it on the fly, as I now do with HTML. What I've seen so far seems

Re: Graphing/Plotting over time

2003-08-28 Thread Chuck Fox
What about using perl to massage the data into a file (or hash) and then using gnuplot ( or Graph::Plot ) Chuck [EMAIL PROTECTED] wrote: --On Wednesday, August 27, 2003 1:29 PM -0500 "Akens, Anthony" <[EMAIL PROTECTED]> wrote: Just wanted to look into a "for fun&quo

Re: FILEHANDLE to print to nothing

2003-08-25 Thread Chuck Fox
There is always /dev/null if you really want it to go to the big bit bucket in the sky. Chuck [EMAIL PROTECTED] wrote: Sure, just use this without an open or close statement... print VOID 'test'; I'm not exactly sure how Perl handles this, but since there is no filehandle call

Re: Perl Codes Written in Windows Env

2003-08-25 Thread Chuck Fox
any issues with running Perl scripts, I have done this many times. BTW, there is a nifty little program called dos2unix (not sure if this is standard for all (*nix)), that removes extraneous carriage returns from files. Chuck Fox [EMAIL PROTECTED] wrote: I have a perl script that I developped

Re: Perl & XS

2003-08-25 Thread Chuck Fox
into memory. For some reason Perl on Linux does not want to scan my LD_LIBRARY_PATH to find the shared libs needed by Sybase. Any clues ? Throwing breadcrumbs is acceptable. Chuck [EMAIL PROTECTED] wrote: Help! I have written a perl module that uses XS to reach out to a password database and

Re: Cron jobs and perl

2003-08-21 Thread Chuck Fox
Venkat, FWIW, I would wrap the whole job in a shell script and have cron execute that. Chuck [EMAIL PROTECTED] wrote: Anytime you have problems with a cron, the easiest place to look first is in the cronlog. If you have root access, look at the file /var/cron/log (this is Solaris, other *nix

Perl & XS

2003-08-20 Thread Chuck Fox
with correctly loading the module, but I am unsure of where to go from here. WTF does wstat = 139 mean ? Any suggestions would be appreciated. BTW, the module cores after the tests are finished. Chuck Fox Principal Database Administrator America Online, INC. Additional Info: Linux AS 2.1

Want to find and process all *.csv files

2003-02-14 Thread Chuck
I have ActivePerl 5.6.0 on Win2000 (in a DOS box). I want to find all .CSV files starting in the directory where the perl script is. I have a program but no files are processed. Can someone help me to get this to work? Here is the code:

Resolved: Good Name Filtering regex

2002-11-26 Thread Chuck Tomasi
at the end. Thanks to all who assisted with the group-think. --Chuck -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Wanted: Good Name Filtering regex

2002-11-26 Thread Chuck Tomasi
Hmmm I'm not getting where I want to go. Consider the following code: #!/usr/bin/perl -w @a = ( "chuck",# Good "chuck99", # bad - numbers in a name? "chuck_5", # bad - numbers/underscore in a name "chuck!3&

Re: What's the use of "symbolic links" (symlink() ) and usual, normal

2002-11-26 Thread Chuck Tomasi
er how it was invoked. if ($0 eq "/path/to/prog1.pl") { print "This is executed as program 1\n"; } else { print "Any other name... calls this code\n"; } # More common code Very useful for security, argument processing, etc. --Chuck > --

Re: Wanted: Good Name Filtering regex

2002-11-26 Thread Chuck Tomasi
side the set of "[\w ]+" ??? (Yes the HTML limits both first and last name fields to 20 characters.) --Chuck -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Wanted: Good Name Filtering regex

2002-11-26 Thread Chuck Tomasi
System Specs Perl 5.6.1 (dev) 5.8.0 (prod) Mac OS X 10.2.2 (dev) NetBSD 1.5.2 (prod) MySQL 3.23.52 I'm writing a web form to accept user applications. Like most programs, I'd like to keep the garbage characters out to limit hacking attempts. I want to verify the firstname and last na

RE: Will not read line and split.

2002-10-04 Thread Chuck Belcher
print "$tstopen\n"; while () { @fields1 = split /:/, $tstopen; print "$fields1[0]\n"; print "$fields1[1]\n"; print "$fields1[2]\n"; print "## End of Test Open ####\n\n"; } } -Original Message- From:

RE: Will not read line and split.

2002-10-04 Thread Chuck Belcher
en (IN1, "< $file"); $tstopen = ; chomp $tstopen; print "$tstopen\n"; @fields1 = split /:/, $tstopen; print "$fields1[0]\n"; chuck -Original Message- From: Mark Anderson [mailto:[EMAIL PROTECTED]] Sent: Friday, October 04, 2002 7:09 PM To: Ch

Will not read line and split.

2002-10-04 Thread Chuck Belcher
$file found in $in_dir\n"; chomp $file; #Open Files open (IN1, "< $file"); $tstopen = ; chomp $tstopen; print "$tstopen\n"; @fields1 = split /:/, $tstopen; print "$fields1[0]\n"; Does anyone have any idea what I am doing wrong .. OS is solaris 8. Chuck

NET::FTP

2002-09-28 Thread Chuck Belcher
:52:47 GMT Warning: Cannot install NET::FTP, don't know what it is. Try the command i /NET::FTP/ to find objects with matching identifiers. Thanks in advance chuck belcher

stuck on finding variables

2002-09-05 Thread Chuck Belcher
I have just started using perl and I have been asked to write a script that will open a perl script, count all of the variables identified by $... and print to the screen the number of unique variables and display a list of variables used. Can anyone tell me where to start? -- To unsubscribe

Checking the status of sendmail

2002-06-03 Thread Chuck Tomasi
the event of things like "no such user". That part seems to be working fine, but I need to increase the robustness a little more if possible. I would like to know if sendmail spits back an error or exit status other than 0. Can eval() be of any help here or is there another way I can

Win2000: how to compile to exe?

2002-03-11 Thread Chuck
I have Activestate Perl 5.6.0 and have been trying to use perlcc.bat to compile a .PL file into a .EXE file. I often get errors like "'' not found" or just the perlcc help screen. How do I compile PL files on Win2000? I read the docs and they were all slanted to unix. Do I need to get a C com

Seeking HTTP module

2002-02-27 Thread Chuck Tomasi
I suspect there is something out there to do what I need, but I'm not quite sure what to look for. I was hoping this would be a more efficient way of asking... Setup: Apache 1.3.x, Perl 5.6.0, Sun Solaris 2.7. I need to write a CGI program that makes an HTTP connection (port 80) and does a GET

RE: Sorting an array of hashes

2002-02-06 Thread Tomasi, Chuck
Thanks all for the reply! This worked wonderfully. I also tried reverse() and switching the a/b around to get a reverse sorted order with equal success. Thanks again! --Chuck > -Original Message- > From: Nikola Janceski [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, February

Sorting an array of hashes

2002-02-06 Thread Tomasi, Chuck
Does anyone have any clever ideas for sorting an array of hashes based on a key such as an ID number? Example: @AoH = ( { ID => 10101, UserID => 1041, Status => 2 }, { ID => 10541, UserID => 1211, Status => 1 }, { ID => 10111, UserID => 1211, Status => 2 }, { ID =

RE: Maintaining a Cache of Hash References

2002-01-16 Thread Tomasi, Chuck
I'll have to keep this in mind. I don't think it applies here since my return value is either a 0 or a 1 (no records read or valid data found). I fill in the hash reference from the database data. It never hurts to learn about a new module! --Chuck > -Original Message-

RE: Maintaining a Cache of Hash References

2002-01-16 Thread Tomasi, Chuck
> >sub GetUser > >{ > > my ($id, $user)=@_; # record number and hash reference to > >populate > > > > if (defined($UserCache[$id])) { > >$user = $UserCache[$id]; > > >return(1); >

Maintaining a Cache of Hash References

2002-01-15 Thread Tomasi, Chuck
return 1; } Thanks --Chuck -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Counting the size of an array reference

2001-12-20 Thread Tomasi, Chuck
= (0, 3, 6, 9, 154); my $LastElement=&MySub(\@MyArray); print "The last element is: $LastElement\n"; What goes in ___? --Chuck -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

How to delete a hash entry

2001-12-07 Thread Tomasi, Chuck
p only reports first and third? foreach $k (keys %list) { print "$k=$list{$k}\n"; } Thanks --Chuck -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Send e-mail attachment

2001-11-27 Thread Tomasi, Chuck
Here's one I can answer! I agonized over this for weeks, but finally got a decent solution that I use every day! For a binary file I would recommend "use MIME:Base64". An example is provided. Notes: o You'll want to use multi-part MIME encoding (hence the use of MIME::Base64). You cou

RE: Re[2]: Getting past "Use of uninitialized value..."

2001-11-21 Thread Tomasi, Chuck
I define global variables in a package (e.g. $MyVars::SystemName = "chuck";). It may only be used in THIS program once, but several other programs need that value. True, modifying it wouldn't be the end of the world, but that could lead to unforeseen problems later if you do some

RE: Getting past "Use of uninitialized value..."

2001-11-21 Thread Tomasi, Chuck
I hate those. I usually end up creating a log file (or stderr in the case of web apps) and just print them out to use them again. Nice debugging, but needless in some cases. If you figure a good way use the variable more than once without affecting the value, I'd like to hear it. --

RE: Name of current sub?

2001-11-21 Thread Tomasi, Chuck
It turns out that (caller 0)[3] got me pretty close to what I was looking for. Thanks. > -Original Message- > From: Bob Showalter [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, November 21, 2001 11:06 AM > To: 'Tomasi, Chuck'; '[EMAIL PROTECTED]' &g

Name of current sub?

2001-11-21 Thread Tomasi, Chuck
I find myself writing this sort of thing a lot: print STDERR "program.pl: subname(): debug statement\n"; I know $0 can be used for programname.pl (except it returns the full path to the program), is there some cool variable to get my hands on the name of the current sub? --Chu

Getting past "Use of uninitialized value..."

2001-11-21 Thread Tomasi, Chuck
using strict, I get the dubious message: Use of uninitialized value in concatenation (.) at /path...pl line 1288 every time a record comes up with no title field populated. Is there some way to make this work whether a value was read from the database or not? print "\t\t$ulist[$i]{'Title

RE: Populating a referenced hash

2001-11-16 Thread Tomasi, Chuck
(@$aref) loop walks right over the hash ref and I get information at the end of @leftovers "main::hash". --Chuck > -Original Message- > From: Dave Storrs [mailto:[EMAIL PROTECTED]] > Sent: Friday, November 16, 2001 11:38 AM > To: '[EMAIL PROTECTED]' > S

RE: Populating a referenced hash

2001-11-16 Thread Tomasi, Chuck
r foreach() loop to dump the values after calling &ref(), there they were. Now to see if my larger program adheres to the same logic. You're confused?! I thought I was a decent Perl programmer until I forced myself to use strict and -w! Thanks! --Chuck > -Original Message-

RE: Populating a referenced hash

2001-11-16 Thread Tomasi, Chuck
be > somewhere else. Step through your code in the debugger. Never used it before. I'll see what I can come up with from the help/manpage. Thanks. --Chuck -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Populating a referenced hash

2001-11-16 Thread Tomasi, Chuck
ds. I saw this done a while ago with a hash, but it was using a convention something like: &mysub(*hashname); What's that all about? How are items in %hashname referenced (or dereferenced as the case may be) in mysub()? --Chuck > -Original Message- > From: Wagner-Davi

Populating a referenced hash

2001-11-16 Thread Tomasi, Chuck
Perl: 5.6.0 OS: Solaris 7 Goal: Scan a text file for key words/values and populate a hash My parsing works, but the main() never sees the values properly. If I'm passing by reference, why isn't the hash I passed getting populated in the main namespace? Thanks --Chuck --

RE: How to pass two hashes to a sub

2001-11-15 Thread Tomasi, Chuck
Dang, I could swear I tried that and it wasn't behaving like it was a ref. Now that I've tried it, I'll have to use it that way. Thanks a lot! > -Original Message- > From: Bob Showalter [mailto:[EMAIL PROTECTED]] > Sent: Thursday, November 15, 2001 2:00 PM > T

RE: How to pass two hashes to a sub

2001-11-15 Thread Tomasi, Chuck
MailAddr}); where mysub is expecting two hashes, but really only uses the Address field from the second. If it must be references, it must be references... --Chuck > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Thursday, November 15, 2001 12:14

How to pass two hashes to a sub

2001-11-15 Thread Tomasi, Chuck
Perl 5.6.0 Sun Solaris 2.7 I'd like to send two or more associative arrays (hashes) to a sub. It looks like the first one makes it but the values of the second never get passed. Am I doing something wrong or is there a better way to do this (I'm hoping you don't say by reference or I'll have to

RE: is there another way to do this?

2001-11-08 Thread Tomasi, Chuck
> die "Only root can run this script" if getpwuid($<) ne 'root'; getpwuid($<) returns the entire passwd entry and would require a little parsing. How about something more like: die "Only root can run this script" if ($< != 0); --Chuck -- To

Global Variables and use strict;

2001-11-08 Thread Tomasi, Chuck
er's examples in the past, but now I understand them well enough to construct and use them myself. My Perl knowledge just went up another knotch! Thank you again! --Chuck -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Defining Global Variables w/use strict;

2001-11-08 Thread Tomasi, Chuck
ght, but how can you print a variable that hasn't > been defined yet? > > dan > > * Tomasi, Chuck ([EMAIL PROTECTED]) wrote: > > System: Sun Ultra 2, Solaris 7 (11/99) > > Perl: 5.6.0 > > > > I have a series of related

RE: Problem with IF statement

2001-11-08 Thread Tomasi, Chuck
An if/else with the same code is pointless. Why not use use the same statement all the time? The %02d won't do anything if both digit places are filled. Printing "5" with %02d comes out 05, printing 25 with %02d comes out 25. What's the point? > -Original Message- > From: [EMAIL PROTE

Defining Global Variables w/use strict;

2001-11-08 Thread Tomasi, Chuck
t "Welcome to $DOMAIN, $ADMIN\n"; #!/usr/local/bin/perl -w use strict; my $DOMAIN="plexus.com"; my $ADMIN="Chuck"; Of course, when I run g.pl I g

the get function does not work!

2001-08-21 Thread Chuck Wrobel
as getprint and getstore work. When I replaced the above line with one of the following, output was returned. getprint ("http://www.google.com";); or $file=test; getstore ("http://www.google.com";, $file); Anyone know why

Re: Can Perl be used to develop test scenarios?

2001-08-01 Thread Chuck Ivy
On Wednesday, August 1, 2001, at 04:29 PM, beginners-digest- [EMAIL PROTECTED] wrote: > Whilst this could be done in Perl, I don't think it has been, and I > don't think it's a task for a beginner. > > I would take a look at comp.software.testing > > Point a browser at http://www.testingfaqs.org/

Stripping $ and , out of price

2001-07-23 Thread Chuck Roberts
I'm trying to take a string, which may or may not contain a $ and/or a comma, and return just the number with 2 decimal places. I am having some trouble. Here is my test code: $a[0]="$1,234.05"; $a[1]="1234.78"; $a[2]="$768"; $a[3]="777.99"; for ($j=0; $j<=3; $j++) { print "$j. " . Stripprice(

Problem with update from ActiveState Perl v 5.00502 to 5.6.1.628

2001-07-19 Thread Chuck Morford
ially it's telling me that the script is not sending any output to the webserver... Any clues for me? Chuck __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail http://personal.mail.yahoo.com/ -- To unsubscribe, e-ma

How Do I Implement an Array or Linked List of Pointers in Perl?

2001-07-17 Thread Chuck Morford
Hi All, I'm a raw newbie to Perl, but have been coding in Turbo Pascal for many years. As a way to learn Perl, I've decided to re-implement a text adventure framework that I wrote in TP many years ago, that served as a Pascal training vehicle for me. In Pascal, I used to create an array or link

Re: Converting Unix paths to windows

2001-06-27 Thread Chuck Ivy
On Wednesday, June 27, 2001, at 08:59 AM, [EMAIL PROTECTED] wrote: Hi, I am writing a script to be used on Windows and many different flavors of Unix. I am looking for a good way to convert Unix paths to Windows. Any Ideas? Not exactly an answer to your question, but perhaps someth

Re: Noobie question

2001-06-13 Thread Chuck Ivy
On Wednesday, June 13, 2001, at 12:05 PM, Ward, Stefan wrote: > Does anyone have an example of a way to write a perl script that will > go out > hit a data base table, pull in a column for that table and use that > column > in a dropdown list? I know what to do once I get that variable > sel

Re: help!

2001-06-05 Thread Chuck Ivy
On Tuesday, June 5, 2001, at 07:37 AM, Randal L. Schwartz wrote: > That's why I bring it up as a meta-topic. We've had > to deal with the same thing on perlmonks.org Randal, no offence meant, but I was under the impression that the purpose of this list was to answer questions, and not say tell

looping over an array of hashes

2001-06-01 Thread Chuck Ivy
First post, quick question: I've got an array of hashes that I'm defining the most basic way I can... my $gSeasonID; my @season_list = ''; while (@fields = $sth->fetchrow_array) { $gSeasonID = $fields[0]; $season_list[$gSeasonID]{number} = $fields[1]; $season_list[$gSeaso