Re: Perl Man Pages

2001-04-19 Thread Paul
Also check out perldoc.com for a web version. For lots of handy tips, try "perldoc -q whatever", which searches the FAQ's. __ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/

Re:[RFC] Gauntlet for teachers

2001-04-20 Thread Paul
--- Casey West <[EMAIL PROTECTED]> wrote: > I am quite pleased with the list so far. I have a further challenge > for all the teachers out there: > > Let's create mini tutorials. The note about hashes tripped my memory > of wanting to do this. I read about one on sort that should be here > so

Re: perldoc error

2001-04-24 Thread Paul
I had a similar problem on a recent upgrade -- I had put a copy of Perl into a local directory for folks who needed it, and it was at a higher priority than the newly installed version in my path list. I copied the new one into the old one's spot, and everything works fine. --- Casey West <[EMAI

Re: quick PERL question

2001-04-24 Thread Paul
--- David Gilden <[EMAIL PROTECTED]> wrote: > Dear Casey and the list, > Thanks for your all of your valuable help, > > What is $|++ for? $| is a boolean Perl variable that determines whether the currently selected default output stream will be unbuffered. The default it STDOUT, so $|=1; means

RE: print statment

2001-04-24 Thread Paul
And for those with embedded JavaScript to write, in which you already have too many quotes: =o) print< wrote: > David Gilden writes .. > > >Original from the class: > > > >print " checked>\n"; > > > > > >Is this bad style? > > yep .. avoid backwhacks at all costs - that's my opinion > > > >

Re: sysread and buffering

2001-04-24 Thread Paul
Another possible solution is to use Brian Ingerson's Inline.pm and code the reads &c. with C's lower level IO. I think a C getc() would do it But be warned that, while it's actually quite friendly, a raw beginner might have some trouble with the Inline stuff, especially if they don't know C.

a resend

2001-04-24 Thread Paul
} The final result: open VOB, "cleartool lsvob|" or die $!; # opens a pipe while(my $entry=) { print " This is first '$entry'" ; } > I am a beginner, so bear with me if there are blunders. No problem. =o) > Thanks in advance for any help. > K

Re: [OT]Re: Admin idea

2001-04-24 Thread Paul
--- Sean O'Leary <[EMAIL PROTECTED]> wrote: > At 09:57 AM 4/24/2001, you wrote: > >And I almost forgot to send this to the list! > >See? lol > > See how useful that Reply-To can be? : ) > > Sean. Even more than you think -- I mistyped the address on the CC: to the list, and it bounced bac

Re: [BPQ] help!! any idea whats wrong with this??

2001-04-24 Thread Paul
sort keys %count; Perl is a wonderfully concise language. The above is strictly given as an example of a few performance tricks that are worth researching. =o) Paul __ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/

Re: Complex Regex.

2001-04-24 Thread Paul
o for any digit here) 0.0, .0, and 0, so we've covered 0.0, -0.0, .0, -.0, 0, and -0. The join stacks them with CRLF's between, accomplishing everything but erasing the leading space on negatives. $result =~ s/^ //omg;# polish out the leading spaces So, we treat $result as multiple

Re: [BPQ] help!! any idea whats wrong with this??

2001-04-24 Thread Paul
Agreed, and thanks for pointing that out! --- Michael Lamertz <[EMAIL PROTECTED]> wrote: > Paul ([EMAIL PROTECTED]) wrote: > > > > #!/usr/local/bin/perl -w > > > > use strict > > open (FILE,$0) or die $!; # this reads itself > > my($data,%cou

Re: More Help: Complex Regex

2001-04-24 Thread Paul
--- [EMAIL PROTECTED] wrote: > Thank you very much for all the great help I received earlier on > extracting numbers from text. There is only one thing I forgot about: > Some of the files have HTML headers and footers. I don't want any > data inside HTML brackets. I tried: > s/<*>//g; > I

Re: [beginner] file parsing question

2001-04-24 Thread Paul
--- Timothy Kimball <[EMAIL PROTECTED]> wrote: > Ah, yes, one of the most frustrating bugs in the world: > : if ($REFln[1] = "SN") { > This *assigns* the value "SN" to $REFln[1]. What you want to do is > *test* it. String comparisons in Perl are done with "eq" (and numeric > comparisons with

Re: if file does not exist create it.

2001-04-24 Thread Paul
already exists as a directory. To be cleaner: unless (-e $folder) { mkdir $folder; } else { die "$folder not a directory!" unless -d _; } Then (assuming you're reading the directory info), opendir DIR, $folder or die $!; Then readdir to get your data. As always, Hope that help

Re: sysread and buffering

2001-04-24 Thread Paul
c() ) Which doesn't work on my box > and even that is harder to use than the module. Frankly, I was kinda > scared of the code put around getc() in the examples, and > Anyway, I just think we should keep advice (because that is really > what we are offer

Re: Global symbol requires explicit pack name

2001-04-24 Thread Paul
--- [EMAIL PROTECTED] wrote: > > > All, > When I use strict function, I get an error in the following > code. > #!/usr/local/bin/perl > use strict ; > my @vob_list = `cleartool lsvob | grep "*"`; > my $entry ; > foreach $entry (@vob_list) { > chomp $entry; > my @fields = split /\s+/, $entr

[OT]Re: What is a "case shell"?

2001-04-24 Thread Paul
--- Greg Meckes <[EMAIL PROTECTED]> wrote: > I'm sure it's ksh (k shell - Unix). The person placing the ad > probably dictated to the person who > actually put the ad in and misunderstood. Not that they could actually say "Korn shell". lol ___

Re: How do I nest quote characters in a print command?

2001-04-24 Thread Paul
is kept exactly as in single-ticks. This text runs until it finds END on a line by itself, though leading whitespace causes confusion. END Hopefully that's more than you need without getting you confused. Play with it some. It'll work. Drop me another note if it doesn't! Paul __ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/

Re: Repeated Words

2001-04-25 Thread Paul
--- "Helio S. Junior" <[EMAIL PROTECTED]> wrote: > Hello, Hi =o) > How do i read a simple file and look for "repeated > words" in each line, writing out the words i have > found and the numbers of line they were found? > > eg: > File ==> Test.Dat > sample line of text. > this line follows anot

Re: Repeated Words

2001-04-25 Thread Paul
--- [EMAIL PROTECTED] wrote: > I believe if you add the (g)lobal modifier and optionally(i), Paul's > line of code may work: > > $line =~ /(\b\w+\b).*\1/ogi; I didn't actually test it -- but wouldn't it still miss interlaced words? like: it might, it might Would it see that "might" was

Re: Global Variables Question

2001-04-25 Thread Paul
--- "Warren D. Johnson" <[EMAIL PROTECTED]> wrote: > > Test.pl uses variables (via use vars) from config.pl. These > variables are defined and given values in config.pl. AFter the first > usage of test.pl, the variables we are pulling in from config.pl no > longer have values. So it's som

Re: missing something obvious [commentary ;O]

2001-04-25 Thread Paul
on, so you get nothing back, and > as it is, your variables stay empty. I didn't read it that way. What I saw was that *any* character would qualify as a seperator, and so all it had to return was the empty space between chars. Paul __ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/

Re: inserting text into file

2001-04-25 Thread Paul
Could this be a buffering problem? Maybe $|=1 at the top of the script would help? Does it need a seek()? Hmm --- Morgan Seppy <[EMAIL PROTECTED]> wrote: > I've inserted text into a file before, but I can't seem to figure > this one out. I'm trying to create a guestbook / message list. > I

RE: inserting text into file

2001-04-25 Thread Paul
--- "Forest, Gary J" <[EMAIL PROTECTED]> wrote: > Now I am pretty new at perl, but I have been a C programmer for over > 15 years. If perl allows you to magically insert into a file that > would be amazing. > > I tested the code below and note that this is not INSERTING text into > the file, but

Re: void context, looping example

2001-04-25 Thread Paul
it matched (though we only kept the first one). In a scalar context, it returns a boolean 1 or '' that says whether it matched anything. *READ* carefully about contexts in Perl. When using a new function, try perldoc -f whatever and pay close attention to what it does under different contexts. Paul __ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/

Re: How to create a log file from a perl script

2001-04-26 Thread Paul
ot;; it goes into $somefile. You can even combine these: open STDERR, ">$somefile" or die $!; select STDERR; warn "This goes to $somefile!\n" if $oops; Paul __ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/

Re: [BPQ] help!! any idea whats wrong with this??

2001-04-26 Thread Paul
" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Cc: "Chris Brown" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > Sent: Tuesday, April 24, 2001 1:03 PM > Subject: Re: [BPQ] help!! any idea whats wrong with this?? > > > > Paul ([EMA

Re: [BPQ] help!! any idea whats wrong with this??

2001-04-26 Thread Paul
--- Paul <[EMAIL PROTECTED]> wrote: > > --- Bill Lawry <[EMAIL PROTECTED]> wrote: > > Pretty cool but when used on a file it breaks hyphenated words into > > their components and counts them separately: > > > > 17 occurrences of 'Acct' >

Re: Error: Runtime Exception

2001-04-27 Thread Paul
--- "Arante, Susan" <[EMAIL PROTECTED]> wrote: > This used to be working but after my very adventurous fiasco > (deleting perl5, installing perl6, deleting perl6, installing perl5 - > yes i deleted not uninstalled), it's not working anymore. I'm running > perl5 on NT. I'd try installing Perl5,

Re: [BPQ] help!! any idea whats wrong with this??

2001-04-27 Thread Paul
$count{$_}++ } $data =~ /(\w+)/sog; > > $count{$_}++ for $data =~ /([\w-]+)/sog; btw, "foreach" might have been more readable here, but "foreach" is pretty much an alias to "for", which is fewer characters to type ~wink~ > - Original Message

Re: Error: Runtime Exception

2001-04-27 Thread Paul
--- "David H. Adler" <[EMAIL PROTECTED]> wrote: > On Thu, Apr 26, 2001 at 06:43:37PM -0500, Arante, Susan wrote: > > This used to be working but after my very adventurous fiasco > > (deleting perl5, installing perl6, deleting perl6, installing perl5 > > - yes i deleted not uninstalled), it's not

Re: Clarification - Re: Include directory as location of perl script

2001-04-27 Thread Paul
--- Johnathan Kupferer <[EMAIL PROTECTED]> wrote: > . . . > Oh, and just to raise some hell: if you're new to Perl, you may also > want to look at Python. I don't know which language I would recomend > more... I recommend Perl to gearheads and programmers looking for a new tool. For rank begi

Re: subroutines in .pm

2001-04-27 Thread Paul
--- "Morse, Loretta" <[EMAIL PROTECTED]> wrote: > Hello, > > Does anybody know how to call a subroutine that is in a .pm file from > another .pm file. Given A.pm === package A; sub a { return "a!\n"; } 1; === and B.pm === package B; use A; sub b { print A::a(); } 1; ===

Re: self-appending code

2001-04-30 Thread Paul
--- [EMAIL PROTECTED] wrote: > I created a first simple program to append code to itself (script > below). Is there a way to get that code interpreted in the same > execution? That didn't happen, but when I started it a second time, > the first appended text was interpreted, the second again not.

Re: capturing a return status on NT

2001-04-30 Thread Paul
ar) > Anybody familiar with this on NT? > Thanks. Honestly, no, but Perl is pretty platform independent. It should be pretty much the same, though I can't promise. Paul __ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/

Re: Got a project for Perl but need some help

2001-04-30 Thread Paul
=> '[EMAIL PROTECTED]', # target email From=> '[EMAIL PROTECTED]', # sender email Message => $msg ) or die $Mail::Sendmail::error; print "Message sent:\n$msg\n$Mail::Sendmail::log\n"; exit; If you run into trouble the docs can&

Re: open file, find lines and print to a second file....

2001-04-30 Thread Paul
--- "McCormick, Rob E" <[EMAIL PROTECTED]> wrote: > gang, > > # problem: open a file > # find lines that meet a condition, put them in an output file > > Could you share some patterns/sample code that you use to accomplish > this task? What pattern do you use when the output file doesn't exis

Re: matching **

2001-04-30 Thread Paul
metacharacters in the expression. If that chokes on the $ in $value, then precede that line with $value = '\Q' . $value . '\E'; but I don't think it will. Paul __ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/

RE: open file, find lines and print to a second file....

2001-05-01 Thread Paul
pretty concise line thereworks well. Thanks. I was proud of it, lol... > I'll need to look up $0 (perldoc perlvar: Contains the name of the > file containing the Perl script being executed. ) Exactly. Die puts file and line if you don

Re: Hash of Arrays Question

2001-05-01 Thread Paul
my $filepath, $artist, is that an oops? =o) > $album,..., $title, $genre) = "$row @{ $tracks{$row} }"; Ah. It's the quotes.^ ^ That makes it a single scalar value, which gets dumped into your first field. > {

Re: Strange chop behaviour

2001-05-01 Thread Paul
--- Francis Henry <[EMAIL PROTECTED]> wrote: > Craig, > > I'm a newbie too, but isn't the function "chomp"? chomp is the one Craig seems to need, but there's also a chop. chop() alsways knock a character off; chomp only pops input record seperators (like newline, or CRLF, depending on what the

RE: IF statements

2001-05-01 Thread Paul
--- Kaustav Bhattacharya <[EMAIL PROTECTED]> wrote: > Mark, > I only recently started coding in PERL so don't take the following as > official. > > There is no CASE statement in PERL. Instead you use something called > SWITCH. > The O'Reilly book has an example of how to use the SWITCH statemen

[OT]RE: IF statements (the ugliest SWITCH! =o)

2001-05-01 Thread Paul
fast way to write production code until you really understand it! Feel free to write me and ask if you're actually interested, tho, lol Paul __ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/

Re: writing an array to file

2001-05-01 Thread Paul
--- Kaustav Bhattacharya <[EMAIL PROTECTED]> wrote: > I have an array populated with data, I want to dump its content to > file but > my following code is not writing any data out! HELP: > > sub wanted { > @FILES = (); > if ( $File::Find::name =~ /_boot\.js$/ ) > { >

Re: eliminating duplicate lines in a file

2001-05-02 Thread Paul
--- cherukuwada subrahmanyam <[EMAIL PROTECTED]> wrote: > Hi, > Iam reading flat text file of 10 lines. Each line has got data of > maximum 10 characters. > I want to eliminate duplicate lines and blank lines out of that file. > i.e. something like sort -u in unix. Got plenty of memory? =o)

Re: test if a directory exists if it does delete it else print directory does not exists

2001-05-02 Thread Paul
--- Peter Lemus <[EMAIL PROTECTED]> wrote: > HI Folks, > > I need to delete some directories, specified in > removedir.txt, I'll like to check whether the file > exists or not, if it doesn't I need to print file has > been deleted. this is what I've done so far. > > use file::spec; > use win32

Re: I am a real begginer to perl......

2001-05-02 Thread Paul
print $line; then you can use standard bash command-line redirection of output and error messages as you're already wont to do. =o) Paul > Thanks in Anticipation, > Regards, > > Thomas Adam > > > Please note that the content of this message is confidential between

Re: eliminating duplicate lines in a file

2001-05-02 Thread Paul
--- "M.W. Koskamp" <[EMAIL PROTECTED]> wrote: > > : open FH, "lines.txt" || die $!; > > : my %uniq; > > : map{$uniq{$_}=1 and print $_ unless $uniq{$_} }; lol -- one better(ish): print map { $uniq{$_} ? '' : $uniq{$_}=$_ } ; #:op __ Do You Ya

RE: I am a real begginer to perl......

2001-05-02 Thread Paul
are lots I left out. Hell, just perldoc perl for a list! > Thanks for any input. > > Olivier > > >-Original Message- > >From:Paul [SMTP:[EMAIL PROTECTED]] > >Sent:Wednesday, May 02, 2001 2:05 PM > >To: n6tadam; [EMAIL PROTECTE

Re: String deconstruction?

2001-05-02 Thread Paul
--- Ross Larner <[EMAIL PROTECTED]> wrote: > Hello. I am attempting to print a string one character at a time. > Right now I am using one while loop with chop to create a new string, > the reverse of the original string, then another while loop with chop > on the reversed string to print out th

Re: String deconstruction?

2001-05-02 Thread Paul
--- Paul Cotter <[EMAIL PROTECTED]> wrote: > There are many ways, here is one that does not involve an array > > my $str = 'paul cotter'; > print $1,$1 while ( $str =~ /^(.)/g ); > > The above prints ppaauull ccooeerr (just to show it is printing > 1 a

Re: system call question

2001-05-02 Thread Paul
--- "J. Patrick Lanigan" <[EMAIL PROTECTED]> wrote: > Now that I have CGI working with apache on my server, I am > experimenting. > Anyhow, I wrote the following script and was wondering how to capture > the output of a system call. I am trying to capture the output so that > I can format it for

Re: system call question

2001-05-02 Thread Paul
--- Casey West <[EMAIL PROTECTED]> wrote: > On Wed, May 02, 2001 at 03:12:23PM -0500, J. Patrick Lanigan wrote: > : Thanks to Paul and Mike for the quick response. > : > : Now, does anyone know how I can trim out the unwanted charecters > from the > : output of a man pa

Re: Get file date.

2001-05-03 Thread Paul
--- Julian Church <[EMAIL PROTECTED]> wrote: > . . . > Can anyone tell me how to use Perl to obtain the modification / > creation date of a file on an NT 4 machine? It should be the same as anywhere else. =o) Try -M $file (which is age in days as of when the script started), or maybe @x=stat($

Re: Formular

2001-05-03 Thread Paul
--- Timothy Kimball <[EMAIL PROTECTED]> wrote: > > : I have a formular with 3 text input fields ( name, fullname, and > street ) > : and 2 submit buttons.The first submit button start a perl-script > "work.pl" > : and the second submit button start an another perl-script > "checkup.pl" > : Now,

Re: transfer files via FTP ????

2001-05-03 Thread Paul
e so many disparate pushes. You could also code something to email the log, or even put it in the crontab (I'm assuming this is in the crontab anyway =o) Paul __ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/

Re: grabbing files...

2001-05-03 Thread Paul
--- "Boex,Matthew W." <[EMAIL PROTECTED]> wrote: > > i have a question. i need to grab files in a mailq and there are > multiple, /var/spool/mqueue1, /var/spool/mqueue2... What do you mean, "grab" them? If you just want a list, use glob(). > i want to grab all the df* files in there. my que

Re: Need Fork/Thread Ideas Please

2001-05-04 Thread Paul
--- Chip Cuntz <[EMAIL PROTECTED]> wrote: > . . . > boxes in the network to do things. Since these functions are > essentially running on "other processors" I would like to > spawn/fork/thread two of them and wait for both there completion. > . . . > What I am looking for is code snippets, an e

Re: Environment variable question

2001-05-04 Thread Paul
--- Hitesh Ray <[EMAIL PROTECTED]> wrote: > I am required to modify an Environment variable from one value to > another using perl script. I can access the env. variables in the perl > script using ENV. How can i modify so that when I exit my perl script > -- the env. variable has new value. Tha

Re: Skipped lines

2001-05-04 Thread Paul
--- Steve Neu <[EMAIL PROTECTED]> wrote: > I was thinking CTRL-C would exit the program prematurely without > printing anything but I didn't try it, so I am probably wrong. Just at a guess, I'd say it depends on the OS. On UNIX, I'd bet you're right.

Re: Counting lines on a file

2001-05-05 Thread Paul
--- Mike Lacey <[EMAIL PROTECTED]> wrote: > my $file = $ARGV(0); carefull there -- $ARGV(0) will probably err. ^ ^ use $ARGV[0] instead. ^ ^ __ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great price

RE: Back slash (Solved)

2001-05-07 Thread Paul
--- justin todd <[EMAIL PROTECTED]> wrote: > thanks Paul > This did the trick!! You're very welcome. Since that was it, do you understand why? In Perl, single-quoted strings are not interpolated (that is, are not parsed for special characters or variables). Thus, if $foo

Re: Regex "([^"]*)

2001-05-07 Thread Paul
--- Clinton <[EMAIL PROTECTED]> wrote: > WOW, thanks a heap. This is the best list ever. lol -- high praise! > The final code that seems to work is: > > use strict; > my $file = "test.txt"; > my $stuff="e:/$file"; > open STUFF, $stuff or die "Cannot open $stuff for read :$!"; > my $file_conten

Re: regexp trouble

2001-05-07 Thread Paul
--- Tony Cook <[EMAIL PROTECTED]> wrote: > On Mon, 7 May 2001, Johan Groth wrote: > > I want to strip a variable of all characters including a token, > > aaa_bbb_ccc_ddd would become bbb_ccc_ddd. > > . . . > > I've tried: > > $tmp = "aaa_bbb_ccc_ddd" > > $tmp =~ /^\w+_/ > > $tmp = $'; > > but th

Re: Parsing a string....

2001-05-07 Thread Paul
--- Craig Moynes/Markham/IBM <[EMAIL PROTECTED]> wrote: > . . . > I have a string like this: > $string1 = "[%a %H:%M:%S %c] - - etc.etc.etc"; > > I need to parse out all the substrings that are similar to "%x" > (where x is any letter) try my @chars = $string1 =~ /%(.)/g; #:o) You can proba

Re: Parsing a string.... [addendum]

2001-05-07 Thread Paul
--- Craig Moynes/Markham/IBM <[EMAIL PROTECTED]> wrote: > . . . > I have a string like this: > $string1 = "[%a %H:%M:%S %c] - - etc.etc.etc"; > > I need to parse out all the substrings that are similar to "%x" > (where x is any letter) If you sepcifically need an alpha character, you might try

where's GDBM?

2001-05-07 Thread Paul
Okay, my turn to ask a newbie question. =o) Our HPUX box didn't have GDBM installed, so I just downloaded and compiled it from GNU, but I still don't have GDBM_File.pm, and I don't see any way to get it aside from either dowgrading to 5.005 or cross-grading to 5.7. I'd rather not use the experime

Re: Regexp: Grouping and replacing with an unknown number of groups

2001-05-10 Thread Paul
--- Craig Moynes/Markham/IBM <[EMAIL PROTECTED]> wrote: > [snip . . . ] > The number of mini-regexp differs depending on the date format line > the user enters. So i find out how make keys there are (thus the > number of mini-regexps) and try to construct a string that will print > out whatever

Re: hex conversion

2001-05-10 Thread Paul
--- Paul Cotter <[EMAIL PROTECTED]> wrote: > From: "Jeff Pinyan" <[EMAIL PROTECTED]> > > On May 10, Paul Cotter said: > > >What combination of sprintf/pack/upack/asc/hex/xyz.pm etc will > > > allow me to convert a string in to a string hex equi

Re: Breaking up a file.

2001-05-10 Thread Paul
so that only newlines followed by letters count. If that's not exactly the effect you want, you could easily edit the pattern. =o) This is assuming the structure of the file is pretty uniformly consistent with the example you gave. Good luck, Paul = print "Just another Perl Hacker\n&quo

Re: check to see if file exists.

2001-05-10 Thread Paul
--- Peter Lemus <[EMAIL PROTECTED]> wrote: > Hi, I need to check to see if a file exists in a > directory, if it does then delete it, else .. > > is this the correct syntax? > > if (-e $file and -f _) { > system ("del $file") ? print "File $file deleted\n" > : warn "File $file WAS removed:

Re: Sorting

2001-05-10 Thread Paul
--- Nic LAWRENCE <[EMAIL PROTECTED]> wrote: > Can anybody suggest the most efficient method to do the following... > > I have an array of email aliases like the following: > [EMAIL PROTECTED]: sys > [EMAIL PROTECTED]: coookiecom > [EMAIL PROTECTED]:

Re: Regexp Question

2001-05-10 Thread Paul
--- Carl Rogers <[EMAIL PROTECTED]> wrote: > Not having Perl up and running, would this work with the > parenthesis?? > $temp = ~ m/PT[\(]*(\w+)[\)]*/; > $value = $1; > I'm sure there is a one-line answer, but I'm too new to know. > > At 05:13 PM 5/10/2001 -0400, Gross, Stephan wrote: > >I w

RE:[OT]Sorting (with friendly list netiquette commentary :)

2001-05-11 Thread Paul
enough, though usually you want a short phrase or sentence. And finally, please don't think this tirade was because I thought someone needed a scolding! lol! I just started an OT comment, and then remembered to mark it and drifted fro

Re: [OT] Origin of "Orcish Maneuver"

2001-05-11 Thread Paul
--- Jeff Pinyan <[EMAIL PROTECTED]> wrote: > >> . . . Orcish maneuver, to increase speed. > >> { my %cache; > >> @new = sort { > >> ($cache{$a}) = $a =~ /\@([^:]+)/ if not exists $cache{$a}; > >> ($cache{$b}) = $b =~ /\@([^:]+)/ if not exists $cache{$b}; > >> $cache{$a} cmp

Re: Mail::Sendmail

2001-05-11 Thread Paul
--- [EMAIL PROTECTED] wrote: > All, I am looking for a way to send the output of a logfile using > Mail::Sendmail. Is that possible? If so can some body give me a high > level syntax. my $content; open LOG, $log or die $!; { local $/ = undef; $content = ; } close LOG; $mail{Message} = "Pre-

Re: Mail::Sendmail (attachment addendum)

2001-05-11 Thread Paul
--- Paul <[EMAIL PROTECTED]> wrote: > --- [EMAIL PROTECTED] wrote: > > All, I am looking for a way to send the output of a logfile using > > Mail::Sendmail. Is that possible? If so can some body give me a > > high level syntax. If the previous method isn'

Re: Regexp Question Again

2001-05-11 Thread Paul
--- "Gross, Stephan" <[EMAIL PROTECTED]> wrote: > I wasn't clear last time. I wrote: > >I want to match the following: > >1) the letters "PT" > >2) a space or nothing > >3) a word that may or may not be in parentheses or even not exist > >and return item #3 (which may be null) > >Example: > >PT

Re: Fastest way to [l]stat every file in a dir

2001-05-11 Thread Paul
> for (keys %{ $dirs{$entry} }) { > gonkulate($entry,$_) if $dirs{$entry}{$_}[0] eq '0'; This would become: for (keys %entry) { gonkulate($entry,$_) if $entry{$_}[0] eq '0'; > } > rend_thee($entry) if exists($meta{$entry}{nuptdate})

Re: CR LF with UNIX and Windows (DOSish?)

2001-05-14 Thread Paul
--- David Falck <[EMAIL PROTECTED]> wrote: > Problem: > I have a fixed length customer record. When I create the record, I > add \n. But my testing tells me that when I read (seek) the record > below, I have to add 2 for Windows or 1 for UNIX. > > # Customer file data - > $cst_template = > "A9A

Re: Printing

2001-05-14 Thread Paul
--- justin todd <[EMAIL PROTECTED]> wrote: > I am looking for a way to print just a certain in a browser. > Is this possible? Seems likely, but I think we'll need a little more info. =o) __ Do You Yahoo!? Yahoo! Auctions - buy the things you want

Re: Array Size Question(s)

2001-05-14 Thread Paul
--- Collin Rogowski <[EMAIL PROTECTED]> wrote: > You get the size of an array by using it in a scalar context. > $size = @a; This is entirely correct. But for those of you who prefer a more explicit syntax, you can put any expression into scalar context with the "scalar" keyword. For my own tast

RE: Array Size Question(s)

2001-05-14 Thread Paul
--- Peter Cornelius <[EMAIL PROTECTED]> wrote: > A cool control structure in perl is the for or foreac loop. With it > you don't need to know the size of the array you can just >for my $thing (@A) { > #do stuff with $thing >} This is very efficient; just keep in mind that $thing i

Re: Perl Beginner

2001-05-14 Thread Paul
--- Edson Manners <[EMAIL PROTECTED]> wrote: > I am having trouble finding a list of formatting characters that deal > with the backslash and forward slash characters in Perl. > For example... What does >if ($line =~ /^$i\./) > mean I understand everything except the characters ^$i\./ > W

Re: How to read backwards in a file.

2001-05-14 Thread Paul
--- Gary Luther <[EMAIL PROTECTED]> wrote: > I guess what I am asking is how in the Perl do you set the read > pointer?? Observe perldoc perlfunc. More specifically: perldoc -f tell perldoc -f seek Just store the address of the pointer after you hit a "node", then go back to the previous

Re: flock

2001-05-15 Thread Paul
--- Peter Scott <[EMAIL PROTECTED]> wrote: > > A rather clever way to emulate locking is to use mkdir() and > > rmdir(). > > Although it requires you to create a lock file, it's atomic and > > safe. > > > > sub lock { > > 1 until mkdir "$_[0].lck", 0777; > > $locked{$_[0]}++; > > } On

Re: CR LF with UNIX and Windows (DOSish?)

2001-05-15 Thread Paul
--- chris brown <[EMAIL PROTECTED]> wrote: > --- David Falck <[EMAIL PROTECTED]> wrote: > >--snip-- > > I am pretty new at Perl so don't know the syntax to do > this, but could you sidestep the issue and count the > number of bytes in \n, then subtract as appropriate? \n is just one byte, but y

RE: CR LF with UNIX and Windows (DOSish?)

2001-05-15 Thread Paul
--- David Falck <[EMAIL PROTECTED]> wrote: > I still haven't figured that one out. My record is 303 and length of > record returns 304. Why... I just don't know. Got a null on it? = print "Just another Perl Hacker\n"; # edited for readability =o) =

Re: FW: delete files

2001-05-15 Thread Paul
--- "Porter, Chris" <[EMAIL PROTECTED]> wrote: > Any ideas??? > > me. I want to create a script that deletes uppercase words from a > > directory using the unlink command. Probably a very simple thing chdir $dir or die $!; opendir DIR, "." or die $!; for my $file (grep { -f $_ } read

Re: passing part of an array to a function

2001-05-15 Thread Paul
} } try looking at the perldocs for perlref perlreftut perlobj perlboot perltoot perltootc Paul (Original code left below for reader's convenience) > my @lines=( # simulate read cobol file > > " file-control.\r\n", > "

RE: perl newbie

2001-05-15 Thread Paul
--- Peter <[EMAIL PROTECTED]> wrote: > when i append the &refresh=x, i get a software error: > Execution of cgi aborted due to compilation errors so what are the other errors? try posting the whole code if necessary, and the whole output to the screen when you try to run it. =o) = print

Re: How can I get all error messages from this script, including system cmds.

2001-05-15 Thread Paul
--- Peter Lemus <[EMAIL PROTECTED]> wrote: > Hi, folks, > > I need to get every possible error on this script > including errors from system commands. lol -- looks more like a batch file. ;o] Seriously, you might consider putting all this in one SOMEFILE.BAT and running that as an open3(), t

Re: How can I get all error messages from this script, including system cmds.

2001-05-15 Thread Paul
--- Jos I Boumans <[EMAIL PROTECTED]> wrote: > well, you can always redirect it to a file like this; >perl foo.pl > /null > even on a wintendo... Doesn't get STDERR, just STDOUT. Then again, I have real trouble in Win32 determining what's going to STDERR anyway = print "Just anoth

STDERR on Win32 [was: Re: How can I get all error messages from this script, including system cmds.]

2001-05-15 Thread Paul
--- Jos I Boumans <[EMAIL PROTECTED]> wrote: > well, you can always redirect it to a file like this; > perl foo.pl > /null > even on a wintendo... Nope, doesn't work. Tested this way: C:\users\default>perl>x print STDOUT "stdout\n"; print STDERR "stderr\n"; ^D stderr C:\users\default>t

Re: STDERR on Win32

2001-05-15 Thread Paul
RE: Collecting error output from child processes on Win32 == I think this will work: open STDERR,">$logfile" or die $!; That should close STDERR and reopen it to the specified output, which child processes will then inherit. Another tr

Re: connecting to other perl programs

2001-05-15 Thread Paul
--- Adam Theo <[EMAIL PROTECTED]> wrote: > hello, all. I have been a user of a particular web-board discussion > forum script for a while now (Darryl C Burgdorf's WebBBS > http://www.awsd.com/scripts/webbbs), and am wanting to develop a perl > script that will pass information directly to it, for

RE: Perplexing problem.........probably beginners luck??

2001-05-15 Thread Paul
--- Peter Cornelius <[EMAIL PROTECTED]> wrote: > The doesn't read into $_. You can add a 'print $_;' in there > to verify it. I think you're getting confused by the >while(){...} > structure. This puts the result of the readline into $_ for you if > the is the only thing in the '()'. Ot

Re: formatting

2001-05-15 Thread Paul
--- Liger-dc <[EMAIL PROTECTED]> wrote: > What does the following formatting do? >$line =~ /^; .ot (\d+)/) ^ Gives you a compile error. Unmatched parens are bad. =o) Otherwise, this line would attempt to match the contents of $line, returning true if $line contai

Re: Sorting a Two Dimensional Array

2001-05-16 Thread Paul
--- Paul Johnson <[EMAIL PROTECTED]> wrote: > On Wed, May 16, 2001 at 10:05:14AM -0700, Matt Noel wrote: > > I have a simple two-dimensional array, call it @Weights. I think > > of the first index as being the Row index and the second being the > > Column index. N

RE: FW: delete files

2001-05-16 Thread Paul
--- "Porter, Chris" <[EMAIL PROTECTED]> wrote: > Silly question --- where do i exactly insert all of my information > that points to where my changes need to be made. Sorry if this is a > stupid question. Thank you. If you don't know, it would be sillier not to ask. =o) chdir "/the/directo

  1   2   3   4   5   6   7   8   9   10   >