Re: perl as win32exe

2001-07-12 Thread pete
Stefan Oswald wrote: > > I sometimes hear there is a compiler avalaible which produces win32exes out > of perl scripts ... > Has anybody further information ?? > I think that the perl script is converted to a bat file , and is loaded as such . Anybody cares to correct me on this . Regards Pete

Making HTML::WikiConverter for MWimporter on Win64

2011-09-22 Thread Pete
help on my next steps would be very much appreciated! Pete

Re: How to truncate a string?

2001-06-06 Thread Pete Emerson
Use substr. This will leave you with 5 characters: $text='abcdefghijklmnopqrstuvwxyz'; $text=substr $text, 0, 5; print "$text\n"; Output: abcde Bruno Veldeman wrote: > Hi, > > I have been looking for a function to truncate a string at a given lenght, but am >lost. > > None of the functions see

Getting results from MySQL

2001-06-07 Thread Pete Emerson
where student_id=$student_id"; $query=$dbh->prepare($prep_query); $query->execute; ($school,$path)=$query->fetchrow_array(); Any easier ways to compact this one would also be terrific. Thanks in advance. Perl rocks. Pete

Re: Getting results from MySQL

2001-06-07 Thread Pete Emerson
27;$username'"; ($daterequested,$datecreated)=$dbh->selectrow_array($prep_query); or you could even go the extreme and put the query in quotes in the parentheses after selectrow_array. Once again, thanks for your input! Pete

Re: the ENV command? parameter?

2001-06-07 Thread Pete Emerson
his for me: color=red&hidden=hello The $ENV{'QUERY_STRING'} is all of the submitted pieces of information all at once, in pairs, with an & separating the pairs. To pull out individual pairs with the CGI module, you can do: $color=param('color'); $hidden=param('hidden'); I hope this helps. Pete

Re: regexp question

2001-06-07 Thread Pete Emerson
replied. Well, there's one more explaination, for whatever it's worth. By the way, I really like those other explainations, it's informative to me as well, even though I've got a correct solution. It just goes to show that while there is always more than one way to DO it in

Re: directory listing to array

2001-06-07 Thread Pete Emerson
using opendir and closedir). Zoiks. Guess that's why I'm reading this list! Pete Shawn wrote: > opendir DIR, $directory or die "can't open $directory: $!\n"; > @files = grep /jpg$/i, readdir DIR; > > On 06/07, John Storms rearranged the electrons to read: [ snip ]

Re: regex question

2001-06-07 Thread Pete Emerson
n ahead of time, and my book backs that up, but I'm losing you after you set the $attr. Inquiring mind(s) want to understand! Thanks. Pete Jeff 'japhy' Pinyan wrote: > On Jun 7, Adrian Pang said: > > >I'm trying to write a regex expression so it will extra

Re: double quotes around a variable

2001-06-07 Thread Pete Emerson
ope that if I'm missing the boat you'll respond. And thank you for mentioning that you've written a book (Perl Debugged, correct?); you've piqued my curiousity. This list is great; I'm learning a lot. Thanks! Pete

Re: SWAPING COLUMNS

2001-06-08 Thread Pete Emerson
Here's my version. It's pretty straightforward, but maybe Ondrej's solution is far better for some reason? #!/usr/bin/perl -w use strict; my $inputfile; my $outputfile; $inputfile='myinfile.txt'; $outputfile='myoutfile.txt'; open (INFILE, "$inputfile") || die "Can't open input file\n"; open (OU

Re: SWAPING COLUMNS

2001-06-08 Thread Pete Emerson
Sorry to reply to my own post, but I just looked carefully at Ondrej's solution, and the nice thing about it is that it doesn't matter what order the columns are in, it will always sort on the header. So his program is a lot more generic than mine. Nice! Pete Pete Emerson wrote: &

RFC on my short recursive code

2001-06-18 Thread Pete Emerson
handled getting the file information (using @ls=`ls -A $dir`). Thank you. Pete #!/usr/bin/perl -w use strict; use File::stat; my $startingdir="/tmp"; # could use $ARGV[0] here to make it more generic my $cutoff=5;# could also pass in the cutoff from the

Re: RFC on my short recursive code

2001-06-18 Thread Pete Emerson
n't cut it for recursion. Is there an easy way to parse those out or ignore them? Can you give an example of how to do the globbing which also ignores . and .. ? Pete

Re: RFC on my short recursive code

2001-06-18 Thread Pete Emerson
Jeff 'japhy' Pinyan wrote: > You could go over the entries from readdir() one at a time: > > opendir DIR, $dir or die "can't read $dir: $!"; > > while (defined(my $file = readdir DIR)) { > next if $file eq '.' or $file eq '..'; > my $full = "$dir/$file"; > # ... > } > > closed

Re: Help pls %

2001-07-13 Thread Pete Sergeant
> open CSV,"

Re: Can Perl 'see' HTML IfModifiedSince calls?

2001-07-13 Thread Pete Sergeant
Perl script. Hope this helps. {Pete --- ($_='Yw_xUabcdtefgdijktljkotiersjkUzxT yvlkbfdtcierstajogvPruntRshackRJelov') =~y/RTUv;wxYz$/ ~'\/;$=();/;eval;print

Re: Tape Processing - - Possible?

2001-07-13 Thread Pete Sergeant
>Are there modules that will allow me to read from and write to tape on a record or block basis? (a) Where have you looked? Have you tried http://www.cpan.org and http://www.google.com ? (b) You can always write a Perl module to wrap around a driver in C, which I'm sure will exist

Re: CGI.pm and form validation

2001-07-13 Thread Pete Sergeant
rt 80. Javascript is nice for telling users if they've got it wrong. If you're going to trust it, you're on crack. Hope This Helps {Pete --- ($_='Yw_xUabcdtefgdijktljkotiersjkUzxT yvlkbfdtcierstajogvPruntRsh

Re: Raw Headers of a Proxy?

2001-07-13 Thread Pete Sergeant
proxy server, and print out all correspondence. Then post it on the web for others to read. Hope This Helps {Pete --- ($_='Yw_xUabcdtefgdijktljkotiersjkUzxT yvlkbfdtcierstajogvPruntRshackRJelov') =~y/RTUv;wxYz$/ ~'\/;$=();/;

Re: CGI-PERL-HTML.......HELP!!!!!!!!!!!!!!!

2001-07-14 Thread Pete Sergeant
Nope, simple filehandle, nothing special for webservers. Happy To Help {Pete --- ($_='Yw_xUabcdtefgdijktljkotiersjkUzxT yvlkbfdtcierstajogvPruntRshackRJelov') =~y/RTUv;wxYz$/ ~'\/;$=();/;eval;print -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: 15 O'Reilly computer books free for download

2001-07-14 Thread Pete Sergeant
No. It's *VERY* illegal. "Brett W. McCoy" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > On Sat, 14 Jul 2001, Mark Winchester wrote: > > > Just found this posted on another site. Many free Perl > > books. > > Is it legal to put those on the web like that? It

Re: Perl/TK GUI IDE? Does one exist?

2001-08-26 Thread Pete Sergeant
reate yoru window look and feel. --- All it takes is a simple look. :) Yup, the Tcl/TK tool can be made to do the trick: http://www.keck.ucsf.edu/~kvale/specperl Have phun Pete --- ($_='Yw_xUabcdtefgdijktljkot

Re: NET::FTP to retrieve files over HTTP?

2001-09-12 Thread Pete Sergeant
"Craig Paterson" <[EMAIL PROTECTED]> wrote in message 021601c13a9a$bae3f240$0925020a@avalon">news:021601c13a9a$bae3f240$0925020a@avalon... > is this possible? or is there another library > i should use? I looked at the HTTP library but > can't see how you would do it and save the file. LWP is yo

Re: Link check problem.

2001-06-06 Thread Pete Emerson
Bruno, I used CGI and LWP::Simple to get ESPN's AL East baseball standings table and then rewrite that table into a format that I wanted. You can see it at http://jasper.cs.yale.edu if you're curious (insert shameless plug for the Red Sox here). But that sort of thing might help you to grab th

Re: Pattern matching problem

2001-09-20 Thread Pete Sergeant
Some other notes... You don't have to use printf - you can use print. And you don't need the brackets, or the inverted commas around $path: if ($path =~ m/^\$/) { print "Path is env var\n"; } else { print "Working on phys.dir\n"; } > > if ( "$path" =~ /^$/ ) { > >printf("p

Re: Any feature equivalent to Macros of C?

2001-09-20 Thread Pete Sergeant
at sim.pl line 3. > BEGIN failed--compilation aborted at sim.pl line 3. That's the standard error message to say that you don't have the module installed. It surprises me somewhat too that you want to use Win32::Process on a non-Windows machine - I would imagine it's kinda OS dep

Re: Where does Makefile.PL pick up include paths from?

2001-09-20 Thread Pete Sergeant
I don't know the answer to your question, but... You can download the PPM files seperately from activestate: http://www.activestate.com/PPMPackages/zips/5xx-builds-only/ You can then use PPM to install them, but I think that part's covered in the readmes. "Reg Smith" <[EMAIL PROTECTED]> wrote i

Re: getting selected lines from a text file

2001-09-21 Thread Pete Sergeant
other text? Sure! This is what Perl excels at. You should go through the file line by line, and write a regular expression to identify mail ids. You can store these and then write them to a file, or write them to a file

Re: perl and ftp

2001-09-21 Thread Pete Sergeant
ould suggest is writing a script that you 'require' that will return a username and password. You could do all kinds of magic to hide and encrypt the user/pass that this script returns, and so on. +Pete -- --- ($_='Yw_

Inserting into the middle of arrays

2001-09-24 Thread Pete Sergeant
How do I insert $scalar into position $x of @array, where $x is smaller than $#array? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Array of Hashes?

2001-09-24 Thread Pete Sergeant
> @hosts = ( list of hashes like below ... ); > %hosts = ( name => "hostname", > ipaddr => "www.xxx.yyy.zzz", > location => "location" >); > > How can produce a sorted list of the hashes based on the hostname and then > access each hash to print the details. > @hosts = sort { %{$a}

Re: How to split it?

2001-10-22 Thread Pete Emerson
I wonder why the use of sprintf? I would have done it this way: foreach (@list) { $_=":$_"; } Is there something that the sprintf does that I'm missing, or is this just another way to skin the same cat? Perhaps in other circumstances sprintf is superior? Just curious,

Re: [Fwd: Stripping slashes in strings]

2001-10-29 Thread Pete Emerson
"string" if\and\only\if they're followed by a ' or ". Hope that helps. >From one beginner to another (i.e. someone else is about to point out a better way), Pete -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: execuating fast...

2001-10-29 Thread Pete Sergeant
e faster, as far as I remember o Try profiling your Perl code to see where it slows down: Brian d Foy covers this in: http://www.ddj.com/columns/perl/2001/0104pl001/0104pl001.htm Uh. Before I go any futher I've found a webpage that offers the rest of my advice and some more: http://use.

Re: execuating fast...

2001-10-29 Thread Pete Sergeant
.com/pub/a/2001/04/10/engine.html is an article I wrote describing one situation where it's *faster* to use text files in a search engine... The best thing to do would be to write a simple test case for each and to test them, using perhaps the profiler discussed earlier. Happy to hel

Re: Problem comparing Strings with IF AND

2001-10-29 Thread Pete Sergeant
od ne $newmethod)) { ... } This is covered in perlop, which you can read by: o Going to http://www.perldoc.com and searching for perlop o Typing 'perldoc perlop' at a computer with Perl installed o Opening $perl_dir/html/lib/pod/perlop.html on a computer with Activestate Perl installed

Re: Using the require command with perl

2001-10-29 Thread Pete Sergeant
isn't perl code and/or doesn't terminate with a true value, then you're doing something wrong. If you're getting an error about not being able to find the module, may I suggest: $file = "/absolute/path/to/files/$FORM{'id'}/options.txt"; eval "

Re: module and logicistics advice, please

2001-10-29 Thread Pete Sergeant
> What I don't yet understand is the other direction: How do I make > individual configuration variables, taken from database.cfg, available in > the modules or db.cgi? I guess that would be a job for "require", but am > not sure. You have a number of options. My prefered one is to do this: (opt

Re: perl source code instructions

2001-10-29 Thread Pete Sergeant
isbnInquiry.asp?mscssid=HMUFLHMEL5 NT8N6GL9PCMT2TD1FGAG12&isbn=0596000324 Or at any good bookstore. +Pete -- [EMAIL PROTECTED] ;;($_='Yw_xUabcdtefgdijktljkotiersjkUzxT yvlkbfdtcierstajogvPruntRshackRJelov')=~ y&/RTUv;wxYz$&/ ~'/;$=();$&&&eval&&a

Re: sub read_config is killing my daemon

2001-10-30 Thread Pete Sergeant
tory Or is it some other message all together? We have a saying somewhere I idle: Look buddy, doesn't work is a strong statement. Does it sit on the couch all day? Is it making faces at you? Does it want more money? Please be specific! So, please be specific! :

Re: good site..

2001-10-30 Thread Pete Sergeant
e CPAN.pm documentation interesting: http://www.perldoc.com/perl5.6.1/lib/CPAN.html Hope this helps +Pete -- [EMAIL PROTECTED] ;;($_='Yw_xUabcdtefgdijktljkotiersjkUzxT yvlkbfdtcierstajogvPruntRshackRJelov')=~ y&/RTUv;wxYz$&/ ~'/;$=();$&&&eval&&print -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Calling external executable with parameter under WinNT.

2001-10-30 Thread Pete Sergeant
> `"$batch" "$name"`; > #! doesn't work - and that's the clue of my problems > > and also system doesn't want to work with $batch and $name as it's parameter `` interpolates. You probably want: `"$batch $name"`; or

Re: beginners join function question

2001-10-30 Thread Pete Sergeant
open(NAMES, "names.txt")||die "$!"; ($result = join '', )=~s/\s+/ /g; +Pete -- [EMAIL PROTECTED] ;;($_='Yw_xUabcdtefgdijktljkotiersjkUzxT yvlkbfdtcierstajogvPruntRshackRJelov')=~ y&/RTUv;wxYz$&/ ~'/;$=();$&&&eval&&print

Re: logging out a user

2001-10-30 Thread Pete Sergeant
Find out your Perl PID, find out the user who's running it, and kill their session using `kill`? +Pete "Bob Showalter" <[EMAIL PROTECTED]> wrote in message 2E4528861499D41199D200A0C9B15BC031B508@FRISTX">news:2E4528861499D41199D200A0C9B15BC031B508@FRISTX

Re: flock() question

2001-10-30 Thread Pete Sergeant
look in to the alarm() function perldoc -f alarm +Pete -- [EMAIL PROTECTED] ;;($_='Yw_xUabcdtefgdijktljkotiersjkUzxT yvlkbfdtcierstajogvPruntRshackRJelov')=~ y&/RTUv;wxYz$&/ ~'/;$=();$&&&eval&&print <[EMAIL PROTECTED]> wrote in message

File::Find and File::stat

2001-10-31 Thread Pete Emerson
generous person has more comments to make. I understand that this might not be the right place for a big "RFC on my program", so feel free to stop reading at this point .Thanks very much in advance. Pete #!/usr/bin/perl -w use strict; use File::

Re: returning more than 1 scalar from a subroutine

2001-10-31 Thread Pete Emerson
If I understand your question correctly, this will work: #!/usr/bin/perl -w use strict; my ($a, $b, $c, $one, $two, $three); $a=1; $b=2; $c=3; ($one, $two, $three)=Change($a, $b, $c); print "$one $two $three\n"; sub Change { my ($x, $y, $z)=@_; $x++; $y=0; $z=10; return ($x, $y, $z

Re: Problem performing a split using triangular brackets

2001-11-01 Thread Pete Emerson
dress\n"; $full_address=~/^"(.+)" <(.+)>$/; $user=$1; $email=$2; print "$user\'s email is $email\n"; If the format is ALWAYS going to be this way, this works, otherwise you might want to make the regex conditional and do some error checking. Hope that helps.

Re: imbed c programs in a perl script and vice versa

2001-11-02 Thread Pete Emerson
;); Now C calling a Perl program: perlhelloworld.pl #!/usr/bin/perl print "Hello, World, in Perl!\n"; cprinter.c gcc -o cprinter cprinter.c #include int main() { system("./perlhelloworld.pl"); } $ ./perlprinter.pl Hello, World, in C! $ ./cprinter H

Re: imbed c programs in a perl script and vice versa

2001-11-02 Thread Pete Emerson
Well, suppose my C program does this: $ ./cprogram First Name: Pete Last Name: Emerson I could use a Perl program like this to analyse the output: The key is that the backticks execute any executable file and store the output. #!/usr/bin/perl -w use strict; my $cstuff=`./cprogram`; my

extracting email addresses

2001-11-08 Thread Pete Emerson
When I send mail to a certain address, the mail gets piped to my perl script. I'm then using Mail::Internet to extract info, including the From header. For me, the header looks like this Pete Emerson <[EMAIL PROTECTED]> 1. I assume that they're all going to look different. Is tha

Re: What is "bubble sort"?

2001-11-16 Thread Pete Emerson
Since we're on the topic of sorts, what are the arguments for the implemented quicksort vs. a radix sort? Pete -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: What is "bubble sort"?

2001-11-16 Thread Pete Emerson
that the data is unsorted or random, it might be to your advantage to run the radix algorithm instead. Thoughts? Anyone done some testing on actual data? What's that timing module again? Pete -- Mynd you, møøse bites Kan be pretty nasti... -- To unsubscribe, e-mail: [EMAIL PRO

Re: What is "bubble sort"?

2001-11-16 Thread Pete Emerson
hat happens. Okay, maybe it's wandering a little far from Perl Beginners, but it sure is interesting! Pete -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: What is "bubble sort"?

2001-11-16 Thread Pete Emerson
Okay, so I'm trying to implement your radix sort, and something's going wrong. When I turn on warnings (I'm using Perl v5.6.0) I get: Multidimensional syntax $table[substr $_, $i, 1] not supported at ./sort3.pl line 31. and when I turn on strict: Can't use an undefined value as an ARRAY reference

Parsing HTML for SPSS

2001-11-27 Thread Pete Emerson
ML source. Argh! Pete -- Mynd you, møøse bites Kan be pretty nasti... -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

detecting a hash of hashes

2001-12-06 Thread Pete Emerson
Here is an example of what I'm doing to detect whether I've got a scalar value in my hash or a hash of hashes: #!/usr/bin/perl -w use strict; my %hash; $hash{name}='Pete'; $hash{color}{favorite}='Blue'; $hash{color}{car}='Silver'; $hash{color}{hous

Digest::MD5

2001-12-11 Thread Pete Emerson
Is there a faster way to calculate the hex md5 of a file? sub md5 { my $file=shift; open (FILE, $file) or die "Can't open '$file': $!"; binmode(FILE); my $hash=Digest::MD5->new->addfile(*FILE)->hexdigest; close FILE; return $hash; } -- To unsubscribe, e-mail: [EMAIL PRO

fun with regex/split

2001-12-12 Thread Pete Emerson
lace "one two" with "one_two" and "one two three" with "one_two_three", thinking that then I could split on spaces and then strip out the _, but I didn't have any luck with that, either. Any pointers would be greatly appreciated. Pete -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: fun with regex/split

2001-12-12 Thread Pete Emerson
ot; foreach (@ar); This works, too, but I don't understand what the ?: is for; my Perl book says it doesn't do backreferences; what does that mean? Oh, fun with regexes. :) Pete -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: fun with regex/split

2001-12-12 Thread Pete Emerson
Jeff 'japhy' Pinyan wrote: > For the task of parsing quoted strings, my book suggests the inchworm > method: > > push @terms, $1 while > /\G\s*"([^"]*)"/g or > /\G\s*(\S+)/g; Hmmm...mine seems to go into an infinite loop: #!/usr/bin/perl -w use strict; my @terms; $_='"one two three"

IMAP via SSL

2002-01-09 Thread Pete Emerson
nybody have tips as to how to get this to work via SSL? I'm guessing I need to use Mail::IMAPClient's Socket() function, but I think maybe I need a different module (IO-Socket-SSL???) to help me out. Any pointers would be appreciated. Maybe there's a module to do IMAP via SSL?

Re: Using SMPT on Windows NT

2002-01-10 Thread Pete Emerson
ndle. which can be downloaded and installed from www.cpan.org. Good luck! Pete Emerson -- Mynd you, møøse bites Kan be pretty nasti... -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Help reqd. for collecting data

2002-01-23 Thread Pete Emerson
Here's my stab at it: #!/usr/bin/perl -w use strict; my %info; open INFILE, "$ARGV[0]" or die "Can't open file: $!\n"; # Open file specified on command line while () { chomp; my ($date, @data)=split; # Capture the date, then the rest $date=~s/_\d{4}$//; # Re

Need help to calculate average value in hash

2004-10-19 Thread Pete Tong
Hi All, I have file: PHI: 15 CA: 32 NY: 14 PHI: 35 NY: 11 CA: 22 NY: 23 CA: 36 I need to put it into hash. Key – State, Value – Number (Average Value!!!) So in output I should have: PHI:25 CA:30 NY:16 - Do you Yahoo!? Yahoo! M

Converting a 'unique' floating point number into a defult FP variable.

2005-04-15 Thread Pete Lancashire
8| |23 16| |___|___| |___|___| |___|___| |M|M|M|M|M|M|M|M| |E|E|M|M|M|M|M|M| |S|E|E|E|E|E|E|E| Least Sig. Byte Most Sig. Byte Sign 1 bit Exp 9 bits Mantissa 14 bits 00 60 c0 = -3.5 00 00 40 = 2.0 00 40 40 = 3.0 00 60 40

code so far Re: Converting a 'unique' floating point number into a defult FP variable.

2005-04-15 Thread Pete Lancashire
)/; print "$1 $2 $3 $4 $5 $6 $7 $8\n"; $ieeedouble =~ /(.)(.{11})(.{52})/; print "IEEEDBL SIGN:$1 EXP:$2 MANT:$3\n"; print "5 " . "-" x 50 . "\n"; # looks ok to me $one = pack "B64", $ieeedouble; # print $one; # od -t x1 40 04 00 00 00 00 00

Re: unable to set cookie when using template toolkit

2011-05-04 Thread Pete Smith
ader without the cookie depending on the behaviour you want. Cheers, Pete On 04/05/11 14:23, Agnello George wrote: Hi In my script i am using template toolkit. I am trying to set the cookie in my browser but all that it does is it prints the following output on my broswer : Set-C

Re: unable to set cookie when using template toolkit

2011-05-04 Thread Pete Smith
. You need to send the header in all cases. Try changing your if block to: if ( $evalue == 3 ) { my $cookie = $cgi->cookie(CGISESSID => $session->id); print $cgi->header( -cookie=>$cookie ); deploy_page(); } else { print $cgi->header; } Pete The $cgi-&g

Re: Rounding Date/Time

2011-05-05 Thread Pete Smith
way? The Modern Perl suggestion when dealing with dates and times is to use DateTime. It is well tested and should handle edge cases you may not have considered. After all, what do you do when you want to round up from 2011-12-24 23:58:00? You can use Math::Round to do the rounding for you. Ch

Re: sendmail in perl

2011-05-12 Thread Pete Smith
I imagine there are going to be many recommendations - and there are always new, "better" modules coming out for this sort of thing. However, I'll kick things off to say I've used MIME::Lite [1] for a long time and it has always done everything I've needed.

Re: [use DBI] - how to improve security in perl script (

2011-05-18 Thread Pete Smith
password in a configuration file (and use something like Config::General to load it) which is only readable by a secured user. You can then setuid [1] the script to execute as that user - however, take note of any security issues this might infer. Cheers, Pete [1] http://en.wikipedia.org/wiki

FH as a value from a list

2012-03-05 Thread Lancashire, Pete
my brain this morning is blocked on this one I have a file something like cpu01 value value value cpu02 value value value cpu03 value value value ... cpu01 value value value cpu02 value value value cpu03 value value value ... cpu01 value value value cpu02 value value value cpu03 value va

SSL and IMAP

2002-03-28 Thread Pete Emerson
o IMAP and SSL, that would be great, too. Pete -- Those responsible for the signature have been sacked. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

use confusion

2002-05-31 Thread Pete Emerson
ssword'; } and then call sub Password from my main perl script, but that doesn't seem like "The Right Way To Do It". Should I be using require instead of use, or something else? Pete -- Those responsible for the signature have been sacked. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Does perl hava free edition for AIX, Solaris?

2013-03-18 Thread Lancashire, Pete
fault, and the default perl that comes with AIX has very few modules. This can cause issues if you try to build the bigger or more conplex modules such as DBI. -pete -Original Message- From: rjc [mailto:r...@linuxstuff.pl] Sent: Monday, March 18, 2013 12:09 PM To: beginners@per

threading stability concerns

2005-11-09 Thread Pete Emerson
vice, personal anecdotes, or online references, pro or con, would be greatly appreciated. Thanks. Pete -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: System call for openssl

2005-11-10 Thread Pete Emerson
x27;$command') is not the same as with double quotes, i.e. system("$command"). With single quotes the $command won't be interpreted. You need double quotes in this case in order for the date command to be successfully executed. Pete On Nov 10, 2005, at 9:32 AM, <[EMAIL

Help with XML::Twig

2006-02-05 Thread Pete Hicks
Hi, I was wondering if someone could point me in the right direction. In my example below, I have a handler that will parse a contact's name into another xml node. However, the problem is that when I do this, the parent node loses an attribute that I am trying to set. Here is example output: [EM

Editing text on the CLI

2002-12-04 Thread Pete Emerson
ake line for editable? i.e. right now, line 4 prints out "Edit this", but I can't use the cursor to delete or modify "Edit this". Is there a way to toggle this behavior on and off? Pete -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Help with merging

2002-12-04 Thread Pete Emerson
How do you determine which pair(s) of words to group together? Are you always grouping items 3 and 4, or might you sometimes want "monkey killed" or "killed elephant" or "with stone" ? There needs to be some way of determining when to pull out a pair and when not to. [EMAIL PROTECTED] wrote: b

Re: Help with merging

2002-12-04 Thread Pete Emerson
$4\n"; print "\$5 --> $5\n"; yields these results: $1 --> ^7Kore^7Adam $2 --> killed $3 --> BEST I TEST $4 --> by $5 --> MOD_MACHINEGUN If "by" is always consistent, it's a bit easier, drop it from the regex altogether: $text=~/^(.*) ($action

Mail::IMAPClient with SSL

2003-01-18 Thread Pete Emerson
t($_), " messages in ", $_, "\n"; } $imap->close(); and it moans that I'm not connected on the $imap->login() line. Can anyone help me make it go? Thanks in advance. Pete -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: looking for a string in multiple files

2003-01-21 Thread Pete Emerson
> if ($result eq $file1) This is checking to see if each line matches the filename itself, not the contents of file1. You were going for the contents of $file1, correct? Here's my stab. Read in the target files first, then match. When it walks through the source file, it will print out the name

Re: cgi and symbolic links

2003-01-23 Thread Pete Emerson
, and the $ENV{SCRIPT_FILNEAME} reflects the fact that it's test2.pl, even though it's a symlink to test.pl You may need that Options line in your section or similar. Pete On Thu, 2003-01-23 at 11:24, Harry Putnam, edited by me for brevity, wrote: > I hoped to have one real cgi

Re: Only numbers

2003-01-23 Thread Pete Emerson
if ($numexs=~/^\d+$/) { # do this if $numexs contains 1 or more numbers, nothing else } else { } Your regex just checks to make sure there's one number in your entire string. Anchor it at the beginning and the end, and then use a + to say "one or more occurances of" ... if ($numexs=~/^[0-9]+$

Re: Hash of Hashes of Arrays?

2003-01-24 Thread Pete Emerson
I'd be tempted to use a hash of hash of hashes, storing it like this: $hash{$city}{$station}{add1}=$address1 $hash{$city}{$station}{add2}=$address2 $hash{$city}{$station}{state}=$state $hash{$city}{$station}{zip}=$zip $hash{$city}{$station}{phone}=$phone So my loop would look like this: foreach my

Re: not getting any result...

2003-01-31 Thread Pete Emerson
The error results of useradd appear to go to STDERR instead of STDOUT. You can redirect them to STDOUT, and therefore capture the results, like this: my $username='username'; my $rescmd=`/usr/sbin/useradd -s /bin/false $username 2>&1`; chomp $rescmd; print "Result is $rescmd\n"; On Fri, 2003-01-3

Re: uploading files

2003-01-31 Thread Pete Emerson
Here's a sample. The trick is to turn on autoflushing ($|=1;) so that your text gets printed out right away. #!/usr/bin/perl -w use strict; use CGI qw(:standard); $|=1; print header; print start_html; for (my $i=0; $i<100; $i++) { print "."; sleep 1; } print "\n"; print end_html; On Fri

Re: Even more regex

2003-01-31 Thread Pete Emerson
Dan, Here's my solution. I'm not capturing the days, hours, minutes, seconds as I go, but I'm sure you can see how to if it's really necessary. #!/usr/bin/perl -w use strict; my @list=('3d4h45m12s', '3h', '5h2m'); foreach (@list) { my $seconds=0; my $string=$_; while ($string=~s/(\

Re: sorting hash numerically

2003-02-04 Thread Pete Emerson
perldoc -q sort foreach $empNo (sort {$a<=>$b} keys %empName) { On Tue, 2003-02-04 at 08:17, Rob wrote: > Hi, I want to sort a hash based on the employee number; I used a foreach > loop but it sorts the hash based on the ascii value. How would I get it > to sort on integer values? -- To unsu

Re: regarding log() function

2003-02-05 Thread Pete Emerson
You probably have the module you need already installed. I did it successfully like this: perl -e 'use Math::Complex; print log(-2.8e-05);' On Wed, 2003-02-05 at 11:41, [EMAIL PROTECTED] wrote: > hi all, > i am using perl 5.8.0 on ix86. i was using an inbuilt function log(). > i am not able to g

Re: How to display dir contents on web page?

2003-02-19 Thread Pete Emerson
On Wed, 19 Feb 2003, Scott, Deborah wrote: > Does anyone know where I can get a script that looks into the contents of a > directory and outputs the contents of the directory into a list that is > displayed on an HTML page? (Also, the names should contain hyperlinks to > those contents.) Deborah,

Re: shlock and retrying

2003-02-20 Thread Pete Emerson
I'm not sure what might be the best way to approach this. I'm not comfy > with an indefinite loop, where if there is some problem removing the lockfile, > my program would wait forever. I'd rather try for a few minutes, then exit > with some error. > > Any pearls of

Re: Shifting

2003-02-25 Thread Pete Emerson
There are probably oodles of ways of doing this. Here are two: # An array slice @[EMAIL PROTECTED]; or # start at position 0, remove 9 elements splice @data, 0, 9; Pete On Tue, 2003-02-25 at 14:39, dan wrote: > onwards. My way of doing this was: > shift(@data); x 9 -- To unsubscr

Re: Using multiple test statements

2003-02-27 Thread Pete Emerson
#!/usr/bin/perl -w use strict; my @list = qw(fred joe bob john dude eddie rob dudette joeshmoe); foreach (@list) { print "$_\n" if (/joe|dude/); } Note that you'll match on dudette and joeshmoe ... if you want an exact match, you could do: print "$_\n" if (/^joe|dude$/); On Thu, 2003-02-27 a

Re: Using multiple test statements

2003-02-27 Thread Pete Emerson
unlike /^(joe|dude)$/. In this case, we can do it either way, but we don't need to capture anything in the regex, hence the reason why Stefan put that in. Pete -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: trying to match variable names

2003-03-06 Thread Pete Emerson
%variable3=(1,2,3,4); # |SOMETEXT should NOT get matched open INFILE, $0; while () { while (m#([EMAIL PROTECTED])#g) { print "$1\n"; } } close INFILE; Pete On Thu, 2003-03-06 at 02:35, Daniel Mueller wrote: > i'm currently trying to match all variables in a file, t

Re: pattern matching problems

2003-03-06 Thread Pete Emerson
On Thu, 2003-03-06 at 09:32, Francesco del Vecchio wrote: > If I have a string as the following: > a xx b a x b > and I try a m/a(.*)b/g > $1 = xx b a x > what have I to do to obtain two matches each of one give me > $1 = x #!/usr/bin/perl -w u

  1   2   >