Re: [Perl-unix-users] problems setting up Activestate Perl...

2001-01-12 Thread $Bill Luebkert
quot; in front of it. > > I made it executable with "$ chmod +x test", but when I run it nothing > > happens (it just returns to another prompt). Any ideas? > > There is a Unix program called 'test' that you are probably running. > Try renaming your pro

Re: [Perl-unix-users] Can't delete files from file-upload-> www user

2001-01-15 Thread $Bill Luebkert
oldmask = umask 0; # now mkdir or open your output file umask $oldmask; # restore umask if you like Optionally as mentioned, just use a CGI script to delete the files since they run as www/wwwrite. -- ,-/- __ _ _ $Bill Luebkert ICQ=14439852 (_/ /

Re: [Perl-unix-users] Read the Last line in a file

2001-02-15 Thread $Bill Luebkert
; while ($char ne "\n") { seek FILE, $pos, SEEK_END; read FILE, $char, 1; print "char read: ", ord $char, "\n"; $pos--; } my $final = ; print "Last line is: $final\n"; There's also a possiblity that the last char isn't

Re: [Perl-unix-users] Crypt::CBC

2001-02-24 Thread $Bill Luebkert
body have any suggestions how I can > encrypt the data and it won't be too long? And, has anyone ran across this > before?? Maybe you could use POST method instead of GET ? -- ,-/- __ _ _ $Bill Luebkert ICQ=14439852 (_/ / )// // DBE Collectibles

Re: [Perl-unix-users] .htpasswd question

2001-02-28 Thread $Bill Luebkert
[0]) { $salt = substr $_[0], 0, 2; # get first 2 chars for salt # else create a salt using time, pid and rand } else { my $tmp = (time + $$) % 65536; srand ($tmp); $salt = $legal[sprintf "%u", rand (@legal)]; $salt .= $legal[sprintf "%u&q

Re: [Perl-unix-users] shell question

2001-03-14 Thread $Bill Luebkert
ss module for other solutions. * Open /dev/tty and use the TIOCNOTTY ioctl on it. See the tty(4) manpage for details. Or better yet, you can just use the POSIX::setsid() function, so you don't have to worry about process groups. * Change directory to / *

Re: [Perl-unix-users] cookies

2001-04-13 Thread $Bill Luebkert
#x27; or use a time in the past. -- ,-/- __ _ _ $Bill Luebkert ICQ=14439852 (_/ / )// // DBE Collectibles http://www.todbe.com/ / ) /--< o // // Mailto:[EMAIL PROTECTED] http://dbecoll.webjump.com/ -/-' /___/_<_http://www.freeyellow.com/members/dbecoll/ __

Re: [Perl-unix-users] please help perl on solaris 5.8

2001-05-15 Thread $Bill Luebkert
ine where possible. > > Waiting for you help !! Well I'll help you find a module to get started: File::Find -- ,-/- __ _ _ $Bill Luebkert ICQ=14439852 (_/ / )// // DBE Collectibles http://www.todbe.com/ / ) /--< o // // Ma

Re: [Perl-unix-users] The meaning of variable

2001-05-23 Thread $Bill Luebkert
"Ricardo Cumberbatch L." wrote: > > Hi every body, > > What the meaning of this $dio."bio"; exactly what is mean. Better written as: $dio . "bio"; append "bio" to the contents of the scalar vrbl $dio. -- ,-/-

Re: [Perl-unix-users] use of carraige return \r

2001-06-05 Thread $Bill Luebkert
I try to go from 2-digit to 1 digit i.e. (11,10,9)the > final output would be "90". It appears that only the > first digit is replaced with 9. Anyone have any > suggestions? This would be useful in printing out > progress of your program. -- ,-/- __ _ _

Re: [Perl-unix-users] use of carraige return \r

2001-06-06 Thread $Bill Luebkert
"$Bill Luebkert" wrote: > > Charles Lu wrote: > > > > If I wanted to print say 10 numbers but instead of > > printing each number on a line, I want each successive > > number to REPLACE the previous number so it appears > > that the number is chan

Re: [Perl-unix-users] removing files of a given size from a given location

2001-06-11 Thread $Bill Luebkert
st your code attempt if you can't get it to work. -- ,-/- __ _ _ $Bill Luebkert ICQ=14439852 (_/ / )// // DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /--< o // // http://dbecoll.webjump.com/ (Free Perl site) -/-' /___/_<_http://www.todbe.com/ ___

Re: [Perl-unix-users] regex performance

2001-06-13 Thread $Bill Luebkert
captured affects the overhead that much. Once you've done one, you've gotten the major overhead (I think). Try timing them with benchmark module and see if it's really all that bad. -- ,-/- __ _ _ $Bill Luebkert ICQ=14439852 (_/ / )// // DBE

Re: [Perl-unix-users] Creating an Environment Variable

2001-06-29 Thread $Bill Luebkert
used; if STRING is too short, nulls are written to fill out SIZE bytes. Return TRUE if successful, or FALSE if there is an error. See also `IPC::SysV' documentation and the `IPC::Shareable' module from CPAN. -- ,-/- __ _ _ $Bill

Re: [Perl-unix-users] Sending out text and html email - Again

2001-07-16 Thread $Bill Luebkert
ld probably make sure that the text portion renders immediately and the images can come later. -- ,-/- __ _ _ $Bill Luebkert ICQ=14439852 (_/ / )// // DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /--< o // // http://

Re: [Perl-unix-users] Perl Newbie - Creating new files

2001-07-26 Thread $Bill Luebkert
know how to make > a new one. Same way you overwrite a file. If it doesn't exist - it will be created. open OUT, ">$die/$file" or die ... -- ,-/- __ _ _ $Bill Luebkert ICQ=14439852 (_/ / )// //

Re: [Perl-unix-users] Re: Perl Newbie - chmod

2001-07-28 Thread $Bill Luebkert
ments, but I cannot get the chmod to > run from within the script at all. > > I am on Perl 5 if that is of any consequence. > > Thank you for any aid you might offer. > > P.S. I read the security faq. Thanks for pointing that out. -- ,-/- __ _ _ $Bill Lue

Re: [Perl-unix-users] Re: Perl Newbie - chmod

2001-07-28 Thread $Bill Luebkert
run it as a setuid script in taint mode being careful to not allow any other users access. Maybe put it under basic authentication to start with and restrict it's functionality to the aliases thingy. There are tons of things to learn when administering UNIX and then the Perl implications on

Re: [Perl-unix-users] How do I send and image email attachement?

2001-07-29 Thread $Bill Luebkert
tion: > attachment; "."filename=\"myfile.txt\"\n"; > print MAIL "\n"; > if (open FILE,"<$myfile") { > while () { print MAIL } > close FILE; > } > print MAIL "\n"; I would switch to MIME::Lite which handle

Re: [Perl-unix-users] UDP broadcasts

2001-08-01 Thread $Bill Luebkert
Can this be done? what stupid, simple thing am I missing? Haven't played with broadcasting in Perl, but try experimenting with: setsockopt to SO_BROADCAST and the addr INADDR_BROADCAST (which should be equiv to inet_aton('255.255.255.255')). -- ,-/- __ _ _

Re: [Perl-unix-users] Re-routing bounced emails in SendMail

2001-08-01 Thread $Bill Luebkert
"The text and message goes here.\n"; > > # Now send the message: > open (MAIL,"|/usr/lib/sendmail -t"); > print MAIL $message; > close (MAIL); Have you tried setting the Reply-To header to where you want the reply to go. Can't guarante

Re: [Perl-unix-users] Grepping information from /etc/passwd

2001-08-27 Thread $Bill Luebkert
} # or you could read it into an array and use grep my @array = ; my @finds - grep /$expr/, @array; close FH; Make sure you escape $expr properly if there are reserved chars in it. -- ,-/- __ _ _ $Bill Luebkert ICQ=14439852 (_/ / )// // DBE Collectibles

Re: [Perl-unix-users] How to make a Silent POST method?

2001-08-30 Thread $Bill Luebkert
f that's not the purpose). A little more background might help. -- ,-/- __ _ _ $Bill Luebkert ICQ=14439852 (_/ / )// // DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /--< o // // http://dbecoll.tripod.com/ (Free site

Re: [Perl-unix-users] Net::FTP hanging

2001-09-04 Thread $Bill Luebkert
me? can I wrap a $ftp->get in an alarm? Luckily you are on UNIX, so alarm should take care of it for you. See perlfunc alarm function for example. You could probably sleep and try again once or twice after the initial failure. -- ,-/- __ _ _ $Bill Luebkert ICQ=1443

Re: [Perl-unix-users] Carp.pm: difference between croak and confess?

2001-09-05 Thread $Bill Luebkert
#x27;s call longmess # to generate a full stack trace. We use the magical form of 'goto' # so that this shortmess() function doesn't appear on the stack # to further confuse longmess() about it's calling package. goto &longmess; -- ,-/- __ _ _

Re: [Perl-unix-users] Converting this code to send a ZIP attachement

2001-09-12 Thread $Bill Luebkert
; "."filename=\"wsr-pro.txt\"\n"; > > print MAIL "\n"; > > if (open CONF," while () { print MAIL } > close CONF; > print MAIL "\n"; > print MAIL "\n"; > } > > = > > Any clues?

Re: [Perl-unix-users] Sub-routines

2001-09-24 Thread $Bill Luebkert
s the error: $ERRMSG\n"; > warn "This is the error: $ERRMSG\n"; > } > } > $notreally=0; > nearlyfatallywounded "This is a Legitimate Error."; > close; > > How do I keep the subroutine from being executed just because it is being > parsed? Works fin

Re: [Perl-unix-users] HTTP::Request & ERROR 500

2001-10-18 Thread $Bill Luebkert
g; > > What could be the problem? > > Both script works fine and no errors when running them into the > debug. Good chance you need to escape the @ in the email address. Can't tell since you didn't figure it was necessary to supply any code. Next time create a small standa

Re: [Perl-unix-users] Directory size

2001-10-25 Thread $Bill Luebkert
nd stat each file and add to a vrbl. You can prune if you don't want to recurse into the subdirs. -- ,-/- __ _ _ $Bill Luebkert ICQ=14439852 (_/ / )// // DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /--< o // // http://dbecoll.tripod.com/

Re: [Perl-unix-users] sendmail

2001-10-28 Thread $Bill Luebkert
uld just CC or BCC all of them (read the file in and create a BCC line for each or you may be able to comma separate on one line - experiment or check the docs). You could use Net::SMTP, the UNIX sendmail task or MIME::Lite to do the actual sending. -- ,-/- __ _ _

Re: [Perl-unix-users] Script works on Windows server but not on UNIX server

2001-11-01 Thread $Bill Luebkert
pache, IIS, etc.) and you didn't supply it. 3) If your server is owned by your ISP - that config could be radically different from the normal setup. More info please. Make sure you're script is in your cgi-bin dir and has the right perms on it 0755 usually. -- ,-/- __

Re: [Perl-unix-users] rewriting data

2001-11-05 Thread $Bill Luebkert
\n"; > exit; 1) You don't want to escape the . in the filename. 2) You closed the file before you printed the two lines to it - move the close to after the prints. -- ,-/- __ _ _ $Bill Luebkert ICQ=14439852 (_/ / )// // DBE Collectibles Mail

Re: [Perl-unix-users] Looking for Module like MIME::Lite with debugger

2001-11-15 Thread $Bill Luebkert
l. You should be able to get debug turned on if you switch to Net::SMTP in MIME::Lite. Untested: MIME::Lite->send('smtp', '.com', Debug => 1); -- ,-/- __ _ _ $Bill Luebkert ICQ=14439852 (_/ / )// // DBE Collectibles

Re: [Perl-unix-users] Problems with URI;

2001-11-28 Thread $Bill Luebkert
t;host; my $query = $u->query; my @response = ($scheme, $opaque, $authority, $path, $fragment, $host, $query); print STDERR "scheme=$scheme\n" if $debug; print STDERR "opaque=$opaque\n" if $debug; print STDERR "authority=$authority\n" if $debug;

Re: [Perl-unix-users] Mime:Lite question

2001-10-14 Thread $Bill Luebkert
s when I enable the mailing functions. If I turn > the mailing functions off, it runs perfectly fine. > > Has anyone seen this with Mime:Lite before? Not really, but did you upload the script using text mode to strip the CR's when you went to a UNIX box ? -- ,-/- __ _ _

Re: [Perl-unix-users] error on close

2001-10-16 Thread $Bill Luebkert
d avoid sharing of files that are NFS'd. What error are you getting when the close fails - ie: what's in !$ and why aren't you printing it ? -- ,-/- __ _ _ $Bill Luebkert ICQ=14439852 (_/ / )// // DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /--< o // //

[Perl-unix-users] Re: Wrangling MySQL table data from UNIX/Apache remote server

2001-12-02 Thread $Bill Luebkert
> '$long_desc', '$weight', '$link')); >print "$string"; > } > > > > open(OUTF,">formatdata.txt") or return "Can't find file: formatdata.txt: > $!"; > > print OUT

Re: [Perl-unix-users] Server-Side Includes in Perl Scripts

2001-12-07 Thread $Bill Luebkert
r Apache. You can easily do the includes from your CGI script though. -- ,-/- __ _ _ $Bill Luebkert ICQ=14439852 (_/ / )// // DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /--< o // // http://dbecoll.tripod.com/ (Free site for Perl) -/-' /___/_<_http://www.tod

Re: [Perl-unix-users] hash array

2001-12-12 Thread $Bill Luebkert
box. yes, no, no. Check out Tie::Hash which will allow you to use a disk DBM file as hash. -- ,-/- __ _ _ $Bill Luebkert ICQ=14439852 (_/ / )// // DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /--< o // // http://dbecoll.tripod.com/ (Free site for Pe

Re: [Perl-unix-users] Regex problem

2002-01-07 Thread $Bill Luebkert
4645 b03 3524 switch 10.3.xxx.xxx 3 new: 20011219 074645 b03-3524-switch 10.3.xxx.xxx 3 old: 20011206 175228 b50 suite-Y switch-A 10.50.xxx.xxx 1 new: 20011206 175228 b50-suite-Y-switch-A 10.50.xxx.xxx 1 -- ,-/- __ _ _ $Bill Luebkert ICQ=14439852

Re: [Perl-unix-users] unpack() problem.

2002-01-08 Thread $Bill Luebkert
3, $field4); my @filedata = ('f12345', 'abcdefg', 'hijklmn', 'opqrstuv'); foreach my $line (@filedata) { # I split this into 2 lines to simplify the eval and added a [0] # which seemed right for the data structure

Re: [Perl-unix-users] Insert Problem

2002-01-24 Thread $Bill Luebkert
$/g; # last \ may be unnecessary -- ,-/- __ _ _ $Bill Luebkert ICQ=14439852 (_/ / )// // DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /--< o // // http://dbecoll.tripod.com/ (Free site for Perl) -/-' /___/_<_http://www.todbe.com/ ___

Re: [Perl-unix-users] %ENV key to determine authenticated user

2002-02-06 Thread $Bill Luebkert
AUTH_TYPE = basic REMOTE_USER = username -- ,-/- __ _ _ $Bill Luebkert ICQ=14439852 (_/ / )// // DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /--< o // // http://dbecoll.tripod.com/ (Free site for Perl) -/-' /___/_&l

Re: [Perl-unix-users] date/time

2002-02-06 Thread $Bill Luebkert
# 06-Feb-2002 my $time = strftime ("%H:%M:%S", localtime);# 14:22:00 open OUT, '>filename' or die "Error opening 'filename': $!\n"; print OUT $date, "\n"; print OUT $time, "\n"; close OUT; __END__ -- ,-/- __ _ _ $

Re: [Perl-unix-users] %ENV key to determine authenticated user

2002-02-06 Thread $Bill Luebkert
nd those are the only two keys that were added (AUTH_TYPE REMOTE_USER). NS also has these two from the browser that MSIE doesn't have (on my tests): HTTP_ACCEPT_CHARSET HTTP_KEEP_ALIVE which really have no bearing. >>-Original Message- >>From: $Bill Luebkert [ma

Re: [Perl-unix-users] How to step over the , while input redirection is not given at commandline

2002-02-14 Thread $Bill Luebkert
ons to proceed. Either of these two methods or both should work: use strict; my $user = (defined @ARGV) ? shift @ARGV : "Anonymous"; # Method 1: if STDIN is a tty if (-t STDIN) { die "perl $0 < data.txt"; } # Method 2: checking for file if (-f STDIN) {

Re: [Perl-unix-users] Help on Array

2002-02-18 Thread $Bill Luebkert
a static init of an array). Show the looping part of it to. With that done, we should be able to figure out exactly what you want and where the data/vrbls are coming from. -- ,-/- __ _ _ $Bill Luebkert ICQ=14439852 (_/ / )// // DBE Collectibles Mailto:[EM

Re: [Perl-unix-users] Simple code to send e-mail vi sendmail

2002-02-20 Thread $Bill Luebkert
")) { # process an error here } print MAIL "To: $mailto\n"; print MAIL "From: $from\n"; print MAIL "Subject: $subject\n"; print MAIL "\n"; print MAIL $mail_msg; print MAIL "\n"; close MAIL; -- ,-/- __ _ _

Re: [Perl-unix-users] Sourcing variable in perl?

2002-03-17 Thread $Bill Luebkert
m command? No, they would be sourced by any shell that was spawned (if that syntax were allowed), but would not make it back to the Perl script that did the system call. A more likely version would be 'system "/path/to/some/shell -c . script_name.scr"'. Fur

Re: [Perl-unix-users] Apache and Perl

2002-03-17 Thread $Bill Luebkert
t does the > redirect.. Are you talking IP address here or what ? If so, check $ENV{REMOTE_ADDR} for the IP address of the requesting browser (or proxy). If not, please explain yourself a littlemore succintly. -- ,-/- __ _ _ $Bill Luebkert ICQ=14439852 (_/ / )// /

Re: [Perl-unix-users] $ENV{REMOTE_PASS}???

2002-03-27 Thread $Bill Luebkert
ready authenticated, so you shouldn't need it. -- ,-/- __ _ _ $Bill Luebkert ICQ=14439852 (_/ / )// // DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /--< o // // http://dbecoll.tripod.com/ (Free site for Perl

Re: [Perl-unix-users] Perl Help Please

2002-03-28 Thread $Bill Luebkert
also try to deal with the "'s in the split, but you'll end up with some extra fields with just " in them. EG: my @data = split /"\s*,?\s*"/, $lines; # would need cleanup on ends of array So I would leave them and drop them later wh

Re: [Perl-unix-users] some more help please?

2002-03-29 Thread $Bill Luebkert
hundreds of ways to do it. You could read the lines into an array and join them with a ','. Then do your split. my @array = ; my $lines = join ',', @array; my @data = split /,/, $lines; -- ,-/- __ _ _ $Bill Luebkert ICQ=14439852

Re: [Perl-unix-users] Removing elements from an array

2002-04-04 Thread $Bill Luebkert
Walter Usyk wrote: > I'm a Perl newbie and would like to know what is the most effecient way > to remove a particular element from an array. I would think splice would be the easiest. -- ,-/- __ _ _ $Bill Luebkert ICQ=14439852 (_/ / )// // DBE C

Re: [Perl-unix-users] Set Time-out within script

2002-04-08 Thread $Bill Luebkert
e 'alarm' function ? -- ,-/- __ _ _ $Bill Luebkert ICQ=14439852 (_/ / )// // DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /--< o // // http://dbecoll.tripod.com/ (Free site for Perl) -/-' /___/_<_http://www.todbe.com/ _

Re: [Perl-unix-users] Hard Total amount of Forks

2002-04-10 Thread $Bill Luebkert
big deal ? You get the pid back after each fork, just store it in an array and you can keep track of how many you have forked. Use waitpid to reap the children periodically (with WNOHANG unless the parent has nothing else to do). -- ,-/- __ _ _ $Bill Luebkert ICQ=1443985

Re: [Perl-unix-users] extract the last character or a string

2002-04-11 Thread $Bill Luebkert
[EMAIL PROTECTED] wrote: > > Thanks to all of you. Problem solved ! $last_char = chop $dir; -- ,-/- __ _ _ $Bill Luebkert ICQ=14439852 (_/ / )// // DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /--< o // // http://dbecoll.tripod.com/ (

Re: [Perl-unix-users] Sending Content-Length via Perl POST

2002-04-15 Thread $Bill Luebkert
gs): $request->header('Content-Length', length $post_args); -- ,-/- __ _ _ $Bill Luebkert ICQ=14439852 (_/ / )// // DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /--< o // // http://dbecoll.tripod.com/

Re: [Perl-unix-users] Multiline substitution

2002-04-18 Thread $Bill Luebkert
t; > Is there an easy way to do this? If you can slurp the entire file into a vrbl: You can slurp the file: { local $/ = undef; $_ = ; } And then add a \s* to your RE (to pick up the newline): s|(\s*)|$1|smg; print $_; __END__ -- ,-/- __ _ _ $Bill Luebkert IC

Re: [Perl-unix-users] downloading File from FTP-server using IO::Socket

2002-04-21 Thread $Bill Luebkert
ld suggest you use Net::FTP instead - much easier (otherwise you would basically have to re-implement FTP protocol). -- ,-/- __ _ _ $Bill Luebkert ICQ=14439852 (_/ / )// // DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /--< o // // http://dbecoll.t

Re: [Perl-unix-users] ^M characters

2002-04-23 Thread $Bill Luebkert
ters > in the file detached from a e-mail. I don't think it can easily be done in the Parser. Slurp the file and delete the \r's (\x0d or \015) and rewrite if you must. On Win32, you would also need to binmode the FH before writing. -- ,-/- __ _ _

Re: [Perl-unix-users] the #! construct to start perl on your system

2002-04-23 Thread $Bill Luebkert
ere to where Perl really resides. I don't think #!perl will work on UNIX (does [or did] or Win32 prior to 2.x.x Apache from command line - don't remember if it works from Apache). -- ,-/- __ _ _ $Bill Luebkert ICQ=14439852 (_/ / )// // DBE Collectibl

Re: [Perl-unix-users] CGI.pm - Cookies - 50-50!?

2002-04-27 Thread $Bill Luebkert
Using a hash for the cookie value is going to concatenate them all together with &'s. I would either use multiple cookies or concatenate the hash together myself into $value and pass it that way. I'm not sure what the intent was for using a hash for the cookie value. -- ,-/- __ _

Re: [Perl-unix-users] CGI.pm - Cookies - 50-50!?

2002-04-28 Thread $Bill Luebkert
/~/, $cgi->cookie('userdata'); # sample snippet: use strict; use CGI; my $cgi = new CGI; my $cookie = $cgi->cookie(-name => 'userdata'); if ($cookie) { # if userdata cookie already set print $cgi->header(); my %values = split /~/, $coo

Re: [Perl-unix-users] perl 5.004 compatibiliy with perl 5.6.0

2002-04-30 Thread $Bill Luebkert
rors or feed the errors back to the browser with something like this: BEGIN { use CGI::Carp qw(carpout fatalsToBrowser); &carpout (\*STDOUT);# back to browser or use a log file # warningsToBrowser(1); # add warnings too if you like (carpout should handle) }

Re: [Perl-unix-users] How to exclude a softlink(pointing to a directory) in File::Find

2002-04-30 Thread $Bill Luebkert
; Any way to do this? Try adding a prune to your code (just a guess): if (-l _) { $File::Find::prune = 1; return; } -- ,-/- __ _ _ $Bill Luebkert ICQ=14439852 (_/ / )// // DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /--< o // // http://

Re: [Perl-unix-users] open file etc..

2002-05-01 Thread $Bill Luebkert
... or die "cannot create counter file: $!"; -- ,-/- __ _ _ $Bill Luebkert ICQ=14439852 (_/ / )// // DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /--< o // // http://dbecoll.tripod.com/ (Free site for Perl) -/-' /___/_<_http://www.todbe.com/

Re: [Perl-unix-users] open file etc..

2002-05-01 Thread $Bill Luebkert
er/counter.txt - $!"; > print OUT $keycounter; > close(OUT); > > return ($keycounter); > > } Check the perms on the directory that it is in to make sure you have the perms to read and write to a file in it. Make sure you know what user you are running as if it's

Re: [Perl-unix-users] perl help

2002-05-01 Thread $Bill Luebkert
thing at all. > > while ($string =~ /process(\S+(?!\|)(\s\S+)*)/g) { >print "\tbiological process\t$1\n"; > } > > Correction to this code or an alternative suggestion is highly appreciated. This should handle the situation above: while ($string =~ /proc

Re: [Perl-unix-users] Formatting problem

2002-05-06 Thread $Bill Luebkert
get that > one extra zeros. > > > > Are there any format specifier like C in perl. perlfunc man page is your friend. Look under (s)printf. PS: please post plain text only to this list. -- ,-/- __ _ _ $Bill Luebkert ICQ=14439852 (_/ / )// //

Re: [Perl-unix-users] ^M characters

2002-06-07 Thread $Bill Luebkert
# where ^V and ^M are ctrl-V and ctrl-M or this may work (or maybe not on UNIX, but it will on Win32): :set notextmode # change to textmode :w # write the file :e! # re-edit the file --

Re: [Perl-unix-users] Executing another perl script asyncronously

2002-06-10 Thread $Bill Luebkert
perlfaq8: How do I start a process in the background? You could use system("cmd &") or you could use fork as documented in the section on "fork" in the perlfunc manpage, with further examples in the perlipc manpage. -- ,-/- __ _ _ $Bill Lue

Re: [Perl-unix-users] Re: Executing another perl script asyncronously

2002-06-10 Thread $Bill Luebkert
"testexec1.pl", I get core dump. > I can do it when I reset: > LD_PRELOAD=;export LD_PRELOAD > But I cannot connect to Oracle. I don't know what LD_PRELOAD does to affect the backgrounding, did you try fork and exec and if necessary reset LD_PRELOAD in just one of the m

Re: [Perl-unix-users] Re: Executing another perl script asyncronously

2002-06-11 Thread $Bill Luebkert
taguti wrote: > >>did you try fork and exec >> > > No I don't like to do it if possible. You know a system call basically does a fork and exec except it waits for the call to finish. -- ,-/- __ _ _ $Bill Luebkert ICQ=162126130 (_/

Re: [Perl-unix-users] Pinging numeric computer names???

2002-06-11 Thread $Bill Luebkert
k minus the problem above. You could try using gethostbyname first and passing the dotted addr to ping. use Socket; my @addr = gethostbyname ('0070123'); print "@addr\n"; print inet_ntoa ($addr[4]), "\n"; __END__ -- ,-/- __ _ _ $Bill Luebke

Re: [Perl-unix-users] LINK CHECKER

2002-06-12 Thread $Bill Luebkert
a couple (not sure if they handle SSL): http://www.stonehenge.com/ in particular, you might find something useful in here: http://www.stonehenge.com/merlyn/WebTechniques/ -- ,-/- __ _ _ $Bill Luebkert ICQ=162126130 (_/ / )// // DBE Collectibles Ma

Re: [Perl-unix-users] regex

2002-06-21 Thread $Bill Luebkert
rs like \x00-\x1f and \x7f-\xff in there too. -- ,-/- __ _ _ $Bill Luebkert ICQ=162126130 (_/ / )// // DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /--< o // // http://dbecoll.tripod.com/ (Free site for Perl)

Re: [Perl-unix-users] Sorting Records In Server Log Files

2002-06-23 Thread $Bill Luebkert
=> 6, 'aug' => 7, 'sep' => 8, 'oct' => 9, 'nov' => 10, 'dec' => 11); use Time::Local; $date =~ s/^\[//; $tz =~ s/\]$//; my @t = split ':', $date; my @d = split /\//, $t[0]; $d[1] = $mons{lc $d[1]}; my $off = 0; $tz =~

[Perl-unix-users] Re: Perl with Java

2002-06-23 Thread $Bill Luebkert
nes) { my @f = split /\s*[:-]\s*/, $line; $hash{$f[0]} = $f[1]; } I'm assuming you have the newline problem in hand. -- ,-/- __ _ _ $Bill Luebkert ICQ=162126130 (_/ / )// // DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /--< o // // http://dbecoll.tripo

Re: [Perl-unix-users] Re: Perl with Java

2002-06-23 Thread $Bill Luebkert
$Bill Luebkert wrote: > karthikeyan wrote: > >> Dear All, >> >> Hope you are all having a great day. >> >> I have a problem. I m running a java program through perl like this : >> >> $cmd = 'java SSLTest'; >> >

Re: [Perl-unix-users] Re: Perl with Java

2002-06-23 Thread $Bill Luebkert
dumping the data in hex and see if maybe you have \r's instead of \r\n's. If there really are no line endings, you could search for the first : (preceded by a non-digit) or - (surrounded by WS) and then pick up the stuff between there and the next one as the value (minuse the last word

Re: [Perl-unix-users] Question on CGI

2002-06-24 Thread $Bill Luebkert
use the POSIX::setsid() function, so you don't have to worry about process groups. * Change directory to / * Reopen STDIN, STDOUT, and STDERR so they're not connected to the old tty. * Background yourself like this:

Re: [Perl-unix-users] File Download

2002-06-30 Thread $Bill Luebkert
P may come in handy. When you have more specific questions, repost. -- ,-/- __ _ _ $Bill Luebkert ICQ=162126130 (_/ / )// // DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /--< o // // http://dbecoll.tripod.com/ (Free site for Perl) -/-' /

Re: [Perl-unix-users] sortByWeek

2002-07-01 Thread $Bill Luebkert
ubstr($_,0,3) = $WeekStr[substr($_,0,1)] > if substr($_,0,3) =~ /[0123456]\x00\x00/; > } > return @in; > } You could try something like this: my @res = &sortByWeek ('FRI0101', 'TUE0202', 'MON2359'); print "@res\n"; sub sortByWeek {

Re: [Perl-unix-users] Reading an uploaded Excel file

2002-08-14 Thread $Bill Luebkert
. > Please HELP !! What do you mean you can't detach it ? Detach from what ? Are you having trouble doing the upload or what ? -- ,-/- __ _ _ $Bill Luebkert ICQ=162126130 (_/ / )// // DBE Collectibles Mailto:[EMAIL PROTECTED] / )

Re: [Perl-unix-users] binary to ascii

2002-08-21 Thread $Bill Luebkert
ck 'SLS', $buf; read IN, $buf, 6 or die ... my ($ST, $LTP) = unpack 'SL', $buf; close IN; __END__ -- ,-/- __ _ _ $Bill Luebkert ICQ=162126130 (_/ / )// // DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /--< o // //

Re: [Perl-unix-users] Can't find string terminator "*END*" anywherebefore EOF

2002-09-01 Thread $Bill Luebkert
Craig B. Nakata wrote: > Normand, > > Looks like there's a quote missing on the subject line. And a missing new Mail::Sender() line. -- ,-/- __ _ _ $Bill Luebkert ICQ=162126130 (_/ / )// // DBE Collectibles Mailto:[EMAIL PROTECTED]

Re: [Perl-unix-users] Can't find string terminator "*END*" anywherebefore EOF

2002-09-01 Thread $Bill Luebkert
ced is wrong - show what it output and what it should be. -- ,-/- __ _ _ $Bill Luebkert ICQ=162126130 (_/ / )// // DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /--< o // // http://dbecoll.tripod.com/ (Free site for Perl) -/-' /___/_&l

Re: [Perl-unix-users] need some help in pattern matching

2002-09-03 Thread $Bill Luebkert
mple enough. Pseudo code: open IN ,,, open OUT ... while () { if comment print to out else breakdown line into fields foreach field write field to OUT endfor endif } Maybe there's

Re: [Perl-unix-users] need some help in pattern matching

2002-09-04 Thread $Bill Luebkert
12.47 // (a9f3702f converted to decimal ) > > I mean to retrieve the IP from the Hex hidden inside use Socket; $_ = "\x00\x02\x0b\xb8\xa9\xf3\x70\x2f\x00\x00\x00\x00\x00\x00\x00\x00"; printf "v6=%d\n", unpack 'n', substr $_, 2, 2; printf "v7=%s\n",

[Perl-unix-users] Re: File age

2002-09-04 Thread $Bill Luebkert
# or mtime is 9 my $age = (time - $ctime) / 86400; -- ,-/- __ _ _ $Bill Luebkert ICQ=162126130 (_/ / )// // DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /--< o // // http://dbecoll.tripod.com/ (Free site for Perl) -/-' /___/

Re: [Perl-unix-users] Re: File age

2002-09-05 Thread $Bill Luebkert
last modified not accessed. Post your failing code snippet so we can debug it for you. -- ,-/- __ _ _ $Bill Luebkert ICQ=162126130 (_/ / )// // DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /--< o // // http://dbecoll.tripod.com/ (Free site for Pe

Re: [Perl-unix-users] Re: File age

2002-09-05 Thread $Bill Luebkert
my $age = int (($time - $mtime) / 86400); # did int to drop fraction print "time=$time, mtime=$mtime, age=$age\n"; -- ,-/- __ _ _ $Bill Luebkert ICQ=162126130 (_/ / )// // DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /--< o // //

Re: [Perl-unix-users] Re: File age

2002-09-05 Thread $Bill Luebkert
e File::stat, you would do it more like: use File::stat; my $st = stat($filname) or die "stat($filename): $!"; my $time = time; # broke time out to print my $age = int (($time - $st->mtime) / 86400); print "time=$time, mtime=$st->mtime, age=$age\n"; -- ,-/- __

Re: [Perl-unix-users] Can I write to an Excel file ?

2002-09-05 Thread $Bill Luebkert
ata. I export my Excel files in tab delimited text files, but I know you can also import/export comma-delimited files. Each tab or comma will cause the next column to fill and each newline will take you to the next row. -- ,-/- __ _ _ $Bill Luebkert ICQ=1621261

Re: [Perl-unix-users] Remove item from array

2002-09-05 Thread $Bill Luebkert
27; in debug) > prior to entering the loop. > > So far as I am aware, I need to define the array outside the 'foreach' > loop so that I can use it in the 'replace' statement. > > So what is the accepted method of populating that first element of the

Re: [Perl-unix-users] how to get the filesystem from a given path

2002-09-09 Thread $Bill Luebkert
sys::DiskFree. I would think that just using any file on that FS would work (can't test here): my $handle = new Filesys::DiskFree; my $avail = $handle->avail('/usr/people/charles'); -- ,-/- __ _ _ $Bill Luebkert ICQ=162126130 (_/ / )

Re: [Perl-unix-users] [PMX:##] Removeing www?

2002-09-10 Thread $Bill Luebkert
tinguish between the two? $email =~ s/^www\.//i; -- ,-/- __ _ _ $Bill Luebkert ICQ=162126130 (_/ / )// // DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /--< o // // http://dbecoll.tripod.com/ (Free site for Perl) -/-&#x

Re: [Perl-unix-users] regexp: JavaScript extractor

2002-09-12 Thread $Bill Luebkert
can play with HTML::Parser or try a simple RE on it: my @scripts = $html =~ m#\s* \s*#gis; -- ,-/- __ _ _ $Bill Luebkert ICQ=162126130 (_/ / )// // DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /--< o // // http://dbecoll.tripod.com/ (Free site for

Re: [Perl-unix-users] parsing files by date within dir

2002-09-12 Thread $Bill Luebkert
= (stat _)[9];# get epoch last modification time next if $ftime < $start;# skip older than start time next if $ftime > $end; # skip newer than end time print "$_\n"; } __END__ -- ,-/- __ _ _ $Bill Luebkert I

  1   2   3   >