Re: ENV & $HOME

2001-06-26 Thread Michael Fowler
On Wed, Jun 27, 2001 at 02:37:55AM -0400, Adam Theo wrote: > i am looking for a way my perl program can automatically get the home > directory of the user. There is, of course, the HOME environmental variable. There is also (getpwuid $>)[7], which gets the home directory from the password datab

Re: Re: types of datas

2001-06-26 Thread Michael Fowler
On Wed, Jun 27, 2001 at 01:15:05PM +0800, Exile wrote: > >>>The problem is that when I compare the first and the second value: If > >>>they're really equals, the program say they are'nt. Notice "really equals". I will be getting back to it. > >>>Is ther a function to convert a value into an in

ENV & $HOME

2001-06-26 Thread Adam Theo
Hello, Adam Theo here; i am looking for a way my perl program can automatically get the home directory of the user. i have come accross the ENV module, and think it will work, but wish to know if it is a standard module with all perl distributions? linux, windows, mac, etc? also, what does EN

Re: compiled/interpreted??

2001-06-26 Thread Me
> [is perl compiled or interpreted?] yes. > Can anyone explain this in detail??? chapter 18 of 3rd edition of Programming Perl.

Re:Re: types of datas

2001-06-26 Thread Exile
Wow pls let me quote back the original writer asking what : >>>I get a value from a URL and I put it into a variable. >>>I have a loop (while) with a value which have different values. >>>The problem is that when I compare the first and the second value: If >>>they're really equals, the progr

Re: Date in NT?

2001-06-26 Thread Eric Beaudoin
At 00:23 2001.06.27, Jeff 'japhy' Pinyan wrote: >On Jun 27, Walt Mankowski said: > >>On Tue, Jun 26, 2001 at 10:53:12PM -0500, Steve Howard wrote: >>> I would suggest using the localtime function. That will work regardless of >>> OS. >>> >>> ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $

Re: Perl Style Question

2001-06-26 Thread Jeff Yoak
At 06:05 PM 6/26/01 -0400, Gross, Stephan wrote: >Why is this style > >if ($x) { > do this; > do that; >} > >typically preferred over > >if ($x) >{ >do this; >do that; >} > This tends to be a hotly debated religious issue. There are people who use that later abomination. ;-) T

compiled/interpreted??

2001-06-26 Thread baby lakshmi
hi while reading use and require modules, i confused with perl is compiled or interpreted.. i read FAQ. but i cudnt understand the following paragraph.. In the following paragraph what is meant by parse tree and What do they mean by front end and backend..Can anyone explain this in detail??? Than

Re: Date in NT?

2001-06-26 Thread Walt Mankowski
On Wed, Jun 27, 2001 at 12:23:36AM -0400, Jeff 'japhy' Pinyan wrote: > Or use the POSIX::strftime() function, which uses its own %X formats to > create a date string. Or the UnixDate() function in Date::Manip.pm, although that's almost certainly overkill for what you're doing here. Walt

Re: HELP! this has me rather ummm PISSED ;)

2001-06-26 Thread Walt Mankowski
On Tue, Jun 26, 2001 at 03:04:33PM -0400, Yacketta, Ronald wrote: > the following should > 1) suck in all the files in a dor > 2) split them into 3 arrays (logger files only) > 3) run a forked egrep on each array of files I don't understand why you're going to all the trouble of building three ar

Re: Date in NT?

2001-06-26 Thread Jeff 'japhy' Pinyan
On Jun 27, Walt Mankowski said: >On Tue, Jun 26, 2001 at 10:53:12PM -0500, Steve Howard wrote: >> I would suggest using the localtime function. That will work regardless of >> OS. >> >> ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = >> localtime(time); >> ($mon, $year) = ($mon+1

Re: Date in NT?

2001-06-26 Thread Walt Mankowski
On Tue, Jun 26, 2001 at 10:53:12PM -0500, Steve Howard wrote: > I would suggest using the localtime function. That will work regardless of > OS. > > ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = > localtime(time); > ($mon, $year) = ($mon+1, $year+1900); That doesn't quite work,

Re: Debugging the CGI - Application

2001-06-26 Thread Rajeev Rumale
Thanks again. Thats a very Nice piece of information ? But unfortunatelly I am using IIS on Win2k platform. I still condsider it as a very useful and important piece of information on this list. with regards Rajeev Rumale ~~~ Rajeev R

RE: Date in NT?

2001-06-26 Thread Steve Howard
I would suggest using the localtime function. That will work regardless of OS. ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime(time); ($mon, $year) = ($mon+1, $year+1900); That example is almost exactly how it appears in perldoc -f localtime in case you need furthe

Date in NT?

2001-06-26 Thread Tom Yarrish
Hey all, Okay, new script, quick question. On Windows NT (comments aside), how would one accomplish the following? (this would be on Unix) $date = `date +"%Y%m%d"; I need to pass the current date to a variable to use later in a script. Thanks, Tom #!/usr/bin/perl -w # 526-byte qrpff, K

Re: types of datas

2001-06-26 Thread Michael Fowler
On Mon, Jun 25, 2001 at 10:14:52PM +0800, Exile wrote: > Q1. simply use this : if (($a =~ $b) && ($b =~ $a)) { $match = "Y" } You're comparing $a to $b using the regex operator. I doubt you intended to do this (if you did, there are various things you did wrong); you should be comparing them wit

Re: Debugging the CGI - Application

2001-06-26 Thread Me
> Any more suggestion ? If you are allowed to modify your web server's setup, then: http://www.masonhq.com/docs/manual/Mason.html and prepare for your world to be turned upside down...

Re: Finding @INC

2001-06-26 Thread Michael Fowler
On Tue, Jun 26, 2001 at 09:44:13AM -0500, Dennis Fox wrote: > My difficulty is that I don't understand how to modify @INC to > include the non-standard locations, so that I don't have to have the user > supply commandline arguments each time the script is needed. perldoc -q 'my own module'

Re: Debugging the CGI - Application

2001-06-26 Thread Rajeev Rumale
Thanks Me ! ;-|? Thanks Me <[EMAIL PROTECTED]> :-) Nice to get a suggestion so fast. It works ! Any more suggestion ? with regards Rajeev Rumale ~~~ Rajeev Rumale MyAngel.Net Pte Ltd.,Ph

Re: Debugging the CGI - Application

2001-06-26 Thread Me
> I am facing was difficulty in debugging the script in my CGI base > application. > > To get the feel of the program I use "print" statements where ever possible. > But causes problem with setting cookies as this header has to be written > before any thing with can be display as html. > > I would

Re: Paging the Data..

2001-06-26 Thread Rajeev Rumale
Thank You very much for the suggestion. (Steve, Abdulaziz, Maxim and all others ) I was trying the way Maxim has suggested, I think there are few script also available to handle the display apart. But I could not use this as the I lose the data consistancy in that. I think the idea given by A

Debugging the CGI - Application

2001-06-26 Thread Rajeev Rumale
Greetings ! I am facing was difficulty in debugging the script in my CGI base application. To get the feel of the program I use "print" statements where ever possible. But causes problem with setting cookies as this header has to be written before any thing with can be display as html. I would

Re: Perl Style Question

2001-06-26 Thread Brett W. McCoy
On Tue, 26 Jun 2001, Gross, Stephan wrote: > Why is this style > > if ($x) { > do this; > do that; > } > > typically preferred over > > if ($x) > { >do this; >do that; > } > > I like the latter example because it's easier to cut and paste the braces > and everything in between. I

Re: Perl Style Question

2001-06-26 Thread Paul
--- iain truskett <[EMAIL PROTECTED]> wrote: > I use cuddled if what I'm doing would look silly otherwise. e.g. > > if ($blah) { > one line; > } elsif ($flurp) { > one line; > } else { > one line; > } Hey! I think that was the thing that made me switch! =o) In C I could say if

Re: Simple Question

2001-06-26 Thread Paul
--- [EMAIL PROTECTED] wrote: > Could someone please explain the use of -> and => as in following > example? > (A poor Windows user ... ) lol > $file = "/home/images/$name"; > open(IMAGE, ">$file") || die "unable to open filehandle $file \n"; > $saveres = $ua->request(HTTP::Request->new(G

RE: Finding @INC

2001-06-26 Thread Peter Cornelius
> My difficulty is that I don't understand how to modify @INC to > include the non-standard locations, so that I don't have to > have the user > supply commandline arguments each time the script is needed. You want the 'use lib "/non/statdard/lib";' directive. You can get more in

Simple Question

2001-06-26 Thread dhopp
Could someone please explain the use of -> and => as in following example? (A poor Windows user ... ) $file = "/home/images/$name"; open(IMAGE, ">$file") || die "unable to open filehandle $file \n"; $saveres = $ua->request(HTTP::Request->new(GET => $pic)); print IMAGE "$saveres";

Finding @INC

2001-06-26 Thread Dennis Fox
Greetings all, I am doing work on a system where custom Perl Modules have been installed in at least two non-standard places -- no, not by me ;-). Since the primary application on this system is to be replicated on several other boxes, I am trying to write a script that will find and iden

Re: types of datas

2001-06-26 Thread Exile
Q1. simply use this : if (($a =~ $b) && ($b =~ $a)) { $match = "Y" } Q2. $integer = int($value) - Original Message - From: Stéphane JEAN BAPTISTE <[EMAIL PROTECTED]> To: PERL <[EMAIL PROTECTED]> Sent: Monday, June 25, 2001 9:05 PM Subject: types of datas Hi! I get a value from a U

RE: Re[2]: A better way?

2001-06-26 Thread Stephen Nelson
Actually, calling a subroutine with an ampersand and no parens does not call the subroutine with no arguments. (To make it clear, though, I AGREE with Jos I. Boumans' larger point, just correcting a smaller point that I think makes his point even more clearly...) Using the ampersand without passi

Re: Perl Style Question

2001-06-26 Thread iain truskett
* Paul ([EMAIL PROTECTED]) [27 Jun 2001 00:50]: > --- iain truskett <[EMAIL PROTECTED]> wrote: > > * Gross, Stephan ([EMAIL PROTECTED]) [26 Jun 2001 22:16]: [...] > I always used the second in C, but once I started using Perl and Java > I kept finding something happening that made it seem more con

Re: Perl Style Question

2001-06-26 Thread Paul
--- iain truskett <[EMAIL PROTECTED]> wrote: > * Gross, Stephan ([EMAIL PROTECTED]) [26 Jun 2001 22:16]: > > Why is this style > > > if ($x) { > > do this; > > do that; > > } > > > typically preferred over > > > if ($x) > > { > >do this; > >do that; > > } I always used the sec

RE: Paging the Data..

2001-06-26 Thread Steve Howard
limit is not ANSI SQL, and in fact, not that many SQL's have a limit key word. MySql is one that does. Some other possibilities for example in MS SQL 7.0 or higher, you can use something like: SELECT TOP 10 Column1, Column2 FROM Table WHERE Somecolumn NOT IN (SELECT TOP 2

Re: Perl Style Question

2001-06-26 Thread Peter Scott
At 06:05 PM 6/26/01 -0400, Gross, Stephan wrote: >Why is this style > >if ($x) { > do this; > do that; >} > >typically preferred over > >if ($x) >{ >do this; >do that; >} > >I like the latter example because it's easier to cut and paste the braces >and everything in between. I als

writing readable Perl

2001-06-26 Thread Gregg Williams
The recent "Re: print FN 'junk\n' " thread makes this an ideal time for me to write this e-mail. I intend this e-mail for the more knowledgeable programmers who are reading this mailing list. --> I do *not* want to start any flames, so please reply to me privately at [EMAIL PROTECTED] <-- I am a

Re: Perl Style Question

2001-06-26 Thread Adam Turoff
On Tue, Jun 26, 2001 at 06:05:15PM -0400, Gross, Stephan wrote: > Why is this style > > if ($x) { > do this; > do that; > } This style is also known as The One True Brace Style, popularized by Kernighan & Ritchie (in _The C Programming Language_). It's also popular with other languages

Re: Perl Style Question

2001-06-26 Thread iain truskett
* Gross, Stephan ([EMAIL PROTECTED]) [26 Jun 2001 22:16]: > Why is this style > if ($x) { > do this; > do that; > } > typically preferred over > if ($x) > { >do this; >do that; > } > I like the latter example because it's easier to cut and paste the > braces and everything in b

Re: Perl Style Question

2001-06-26 Thread Paul Johnson
On Tue, Jun 26, 2001 at 06:05:15PM -0400, Gross, Stephan wrote: > Why is this style > > if ($x) { > do this; > do that; > } > > typically preferred over > > if ($x) > { >do this; >do that; > } > > I like the latter example because it's easier to cut and paste the braces > a

Re: 'use strict' kills Oracle spooling...

2001-06-26 Thread Michael Fowler
On Tue, Jun 26, 2001 at 05:17:00PM -0400, [EMAIL PROTECTED] wrote: > Does anyone familiar with 'use strict' know what may be going on? (Please > don't make fun of the way I'm accessing the database. It works, and > besides, I've been too lazy to learn about the DBI package/module thing.) I can f

Re: array slice question

2001-06-26 Thread Michael Fowler
On Tue, Jun 26, 2001 at 04:46:24PM -0400, Bradford Ritchie wrote: > ...but I really need to print everything after the 8th element. If the > ...array were named, I could do something like this: > > @arr = split(/:/); > print @arr[1,6,8..$#arr]); Your asked question was answered well by St

RE: array slice question

2001-06-26 Thread Peter Cornelius
I don't think so. I do (split)[-1] regularly and it works fine. If you left out the parens however it would think this was a pattern to match. I was told by someone on perlmonks that the failure of [3 .. -1] with split is something that should be fixed in subsequent versions of Perl. > > [

Perl Style Question

2001-06-26 Thread Gross, Stephan
Why is this style if ($x) { do this; do that; } typically preferred over if ($x) { do this; do that; } I like the latter example because it's easier to cut and paste the braces and everything in between. I also think it looks better. But none of the top programmers ever see

RE: removing white space

2001-06-26 Thread Peter Cornelius
> Is the following regrex the correct way to remove leading or > trailing white space > from a string? > > $data = "[EMAIL PROTECTED] (mike smith)" > > $data =~ s/(^\s+)|(\s+$)//g; This looks like it works to me. > or would it be more efficient to it thus: > > # two passes > $data =

Re: array slice question

2001-06-26 Thread royce . wells
[1,6,8..-1] in this case "-" is seen as a metacharacter inside the character class and is not seen as -1 Hi, I have an unnamed array which I created from splitting up a colon separated string: $_ = "0th:1st:2nd:3rd:4th:5th:6th:7th:Some random text: might have :colons: or might n

Re: removing white space

2001-06-26 Thread Jos I. Boumans
Hey david, this regexp will do the trick for you: $_ = '[EMAIL PROTECTED] (mike smith)'; s/^\s+|\s+$//g; you dont need the parenthesis around it, unless you want to capture the whitespace (which seems futile) i'd say compiling a regexp twice would be more of a drain on system resources t

Re: removing white space

2001-06-26 Thread Jeff 'japhy' Pinyan
On Jun 26, David Gilden said: >Is the following regrex the correct way to remove leading or trailing >white space from a string? Use two passes. >$data =~ s/^\s+)//; >$data =~ s/\s+$)//; Err, extra )'s in there. $data =~ s/^\s+//; $data =~ s/\s+$//; -- Jeff "japhy" Pinyan [EMAIL PR

Re: array slice question

2001-06-26 Thread dave hoover
Bradford wrote: > Hi, > > I have an unnamed array which I created from > splitting up a colon separated string: > > $_ = "0th:1st:2nd:3rd:4th:5th:6th:7th:Some > random text: might have :colons: or might not" > print ((split /:/)[1,6,8]); > > ...but I really need to print everythi

Re: size of hash?

2001-06-26 Thread iain truskett
* P lerenard ([EMAIL PROTECTED]) [26 Jun 2001 21:48]: > HI, > that's not $#hash, so it is... my $hashsize = keys %hash; i.e. keys %hash returns an array of keys, and arrays used in a scalar context evaluate to the size of the array. Or: print "I have ".(scalar keys %hash)." keys in my hash.\n"

Re: size of hash?

2001-06-26 Thread Paul
--- P lerenard <[EMAIL PROTECTED]> wrote: > that's not $#hash, so it is... try scalar %hash; __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail http://personal.mail.yahoo.com/

RE: array slice question

2001-06-26 Thread Stephen Nelson
Well, if you're OK with printing the colons in the last field, you could simply say: print ( ( split(/:/, $_, 9) )[1,6,8] ); Since that'll absorb all of the ending fields into the ninth (from zero, so index 8) field. That would be the correct thing to do if the colons in the ending field are not

size of hash?

2001-06-26 Thread P lerenard
HI, that's not $#hash, so it is... Thanks Pierre _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Re: use of $_

2001-06-26 Thread Me
> What actually sets the default variable? All sorts. Totally ad hoc. Be prepared to check and learn what does or doesn't set and use it, or realize that it can be changed on you by something else. When you know what you are doing, you may find localizing $_ useful, but it would be remiss of me

removing white space

2001-06-26 Thread David Gilden
Is the following regrex the correct way to remove leading or trailing white space from a string? $data = "[EMAIL PROTECTED] (mike smith)" $data =~ s/(^\s+)|(\s+$)//g; or would it be more efficient to it thus: # two passes $data =~ s/^\s+)//; $data =~ s/\s+$)//; Final comment when I am

Re: print FN "junk\n";

2001-06-26 Thread Paul
--- Paul Johnson <[EMAIL PROTECTED]> wrote: > As far as syntax is concerned I thinks that has merit, but Perl has a > number of idioms that you just have to learn. Once learnt, you will > be able to write better programs and maintain others' programs. (Not > that this is necessarily one of tho

'use strict' kills Oracle spooling...

2001-06-26 Thread Peter_Farrar
I'll try and keep it short. I have code that opens an Oracle client and pipes it a few SQL statements, including spool. I've heard a lot about 'use strict' and I felt that my code was actually organized well enough to pull this off, so I tried it. The only change I made was to declare all variab

Re: Variable scoop

2001-06-26 Thread Me
> I don't know why it was not working earlier > when emailLog = 'logs/email_log'; > was out of the sub block. Did you use a 'package' command anywhere?

Re: print FN "junk\n";

2001-06-26 Thread Paul Johnson
On Tue, Jun 26, 2001 at 01:27:55PM -0700, Paul wrote: > No doubt, and no offense intended. Oh! None taken. > It's just that we have a guy here in th shop who's *neurotic* about > readability, and it's a habit I'm trying to develop. It's not such a bad habit > If a newbie can look at it

Re: print FN "junk\n";

2001-06-26 Thread Randal L. Schwartz
> "Paul" == Paul <[EMAIL PROTECTED]> writes: >> > > select((select(OFN), $| = 1)[0]); Paul> No doubt, and no offense intended. Thank you, since I'm the creator of that mystical snippet. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <[EMAIL PROTECTED]> h

array slice question

2001-06-26 Thread Bradford Ritchie
Hi, I have an unnamed array which I created from splitting up a colon separated string: $_ = "0th:1st:2nd:3rd:4th:5th:6th:7th:Some random text: might have :colons: or might not" print ((split /:/)[1,6,8]); ...but I really need to print everything after the 8th element. If the ar

while ($line = <$remote>) works with text file, but not with telnet session

2001-06-26 Thread Craig S Monroe
Posting again because subject line is misleading. Sorry for the inconvenience CM > Hello all, > > I am writing a script that opens up a telnet session with a specific device, > and issues a command. > I would then like to look through each of the lines and look for the target > line by matching

Re: print FN "junk\n";

2001-06-26 Thread Paul
--- Paul Johnson <[EMAIL PROTECTED]> wrote: > On Tue, Jun 26, 2001 at 12:59:06PM -0700, Paul wrote: > > > > --- Paul Johnson <[EMAIL PROTECTED]> wrote: > > > select((select(OFN), $| = 1)[0]); > > > > LOL!!! > > Cool! And a lovely pirece of cryptocontext. > > But I'd hate to maintain it la

Re: print FN "junk\n";

2001-06-26 Thread Paul Johnson
On Tue, Jun 26, 2001 at 12:59:06PM -0700, Paul wrote: > > --- Paul Johnson <[EMAIL PROTECTED]> wrote: > > select((select(OFN), $| = 1)[0]); > > LOL!!! > Cool! And a lovely pirece of cryptocontext. > But I'd hate to maintain it later. =o) > Not that I haven't done *FAR* worse! ;op It's act

use of $_

2001-06-26 Thread Tim Grossner
What actually sets the default variable? I am setting an array up, @targets, and then calling the current object in the array via $_...but if I set another variable after setting up the array, with it takeover the place of $_ ? Tim Grossner voice - 217-438-6161 pager - 217-467-3148 cell - 217

patch_gd.pl prob

2001-06-26 Thread [Rajib Mukherjee]
hi i am trying for 3 days to get GD.pm to work on sun4x solaris server. i have libgd-1.8.3 and GD-1.33 packages however i need to run licoln stiens patch ptach_gd.pl now command #perl patch_gd.pl in a libgd-1.8.3 dir resulsts in usage error on patch so i go into the patch_gd.pl file and remove th

Re: print FN "junk\n";

2001-06-26 Thread Paul
--- Paul Johnson <[EMAIL PROTECTED]> wrote: > select((select(OFN), $| = 1)[0]); LOL!!! Cool! And a lovely pirece of cryptocontext. But I'd hate to maintain it later. =o) Not that I haven't done *FAR* worse! ;op __ Do You Yahoo!? Get personal

RE: HELP! this has me rather...

2001-06-26 Thread Paul
--- Stephen Neu <[EMAIL PROTECTED]> wrote: > :>exec $cmd, $lookFor, @{$LOGS[$_]} unless $pid=fork; # fork new > > I might be off my rocker, but do you want that to say... > unless $pid == fork; # equality, not assignment... > perhaps? If I'm off base, feel free to tell me to get lost

Re: print FN "junk\n";

2001-06-26 Thread Paul Johnson
On Tue, Jun 26, 2001 at 03:42:34PM -0400, Yacketta, Ronald wrote: > what gives, I open a FH (open OFN ">>junk.out" ); > I autoflush.. > $| = 1; > > do some parsing.. do some other gook > then go and print OFN "my output crud\n"; > but yet, nothing is in file... UNTIL I close(OFN); > Huh? me loos

Re: print FN "junk\n";

2001-06-26 Thread Paul
--- "Yacketta, Ronald" <[EMAIL PROTECTED]> wrote: > Folks, > > a really DUH question here.. > > what gives, I open a FH (open OFN ">>junk.out" ); > I autoflush.. > $| = 1; That autoflushes STDOUT. Try this: open OFN, ">>junk.out" or die $!; { my $prevh = select OFN; $|=1; select $prevh; }

RE: HELP! this has me rather...

2001-06-26 Thread Brett W. McCoy
On Tue, 26 Jun 2001, Stephen Neu wrote: > :>exec $cmd, $lookFor, @{$LOGS[$_]} unless $pid=fork; # fork new > > I might be off my rocker, but do you want that to say... > unless $pid == fork; # equality, not assignment... > perhaps? If I'm off base, feel free to tell me to get lost. N

Re: print FN "junk\n";

2001-06-26 Thread Brett W. McCoy
On Tue, 26 Jun 2001, Yacketta, Ronald wrote: > what gives, I open a FH (open OFN ">>junk.out" ); > I autoflush.. > $| = 1; > > do some parsing.. do some other gook > then go and print OFN "my output crud\n"; > but yet, nothing is in file... UNTIL I close(OFN); > Huh? me loosing it here.. bring me

RE: HELP! this has me rather ummm PISSED ;)

2001-06-26 Thread Paul
--- "Yacketta, Ronald" <[EMAIL PROTECTED]> wrote: > > > > Try splice here: > > > >my $third = int(scalar @allfiles / 3); > >my @set = ( [ splice @allfiles, 0, $third ], # first third > > [ splice @allfiles, 0, $third ], # second third > > [ @allfiles

RE: HELP! this has me rather...

2001-06-26 Thread Stephen Neu
:>exec $cmd, $lookFor, @{$LOGS[$_]} unless $pid=fork; # fork new I might be off my rocker, but do you want that to say... unless $pid == fork; # equality, not assignment... perhaps? If I'm off base, feel free to tell me to get lost.

print FN "junk\n";

2001-06-26 Thread Yacketta, Ronald
Folks, a really DUH question here.. what gives, I open a FH (open OFN ">>junk.out" ); I autoflush.. $| = 1; do some parsing.. do some other gook then go and print OFN "my output crud\n"; but yet, nothing is in file... UNTIL I close(OFN); Huh? me loosing it here.. bring me back to sanity please

RE: Variable scoop

2001-06-26 Thread David Gilden
Here's the latest revision, I don't know why it was not working earlier when emailLog = 'logs/email_log'; was out of the sub block. This script is contained in one file, with on 'use' or 'require' statements. The next revision I see is to move the regrex up to top of the sub where the append t

RE: HELP! this has me rather ummm PISSED ;)

2001-06-26 Thread Yacketta, Ronald
> > Try splice here: > >my $third = int(scalar @allfiles / 3); >my @set = ( [ splice @allfiles, 0, $third ], # first third > [ splice @allfiles, 0, $third ], # second third > [ @allfiles ], # the rest. >); > umm sure, just go abo

Re: curly braces

2001-06-26 Thread Paul
--- Jeff 'japhy' Pinyan <[EMAIL PROTECTED]> wrote: > On Jun 26, Silvio Luis Leite Santana said: > >Why does code 1 work, but code 2 doesn't? > >(the diference is the ; after print) > >$bissexto and { print "OK\n" }; > >$bissexto and { print "OK\n"; }; > > In the first code, Perl thinks you're co

Re: curly braces

2001-06-26 Thread Paul
--- Silvio Luis Leite Santana <[EMAIL PROTECTED]> wrote: > Please > Why does code 1 work, but code 2 doesn't? > (the diference is the ; after print) > After all, is it posible or not to put a block > in place of a expression? > Thanks in advance > Silvio > > CODE 1 - WORK > > $bissexto = ; > c

Re: curly braces

2001-06-26 Thread Michael Fowler
On Tue, Jun 26, 2001 at 04:07:06PM -0300, Silvio Luis Leite Santana wrote: > $bissexto = ; > chop($bissexto); > $bissexto and { print "OK\n" }; > print "end\n"; You obviously aren't running with warnings on. With warnings turned on, your code produces the following (perl 5.6.1): Useless use

Re: HELP! this has me rather ummm PISSED ;)

2001-06-26 Thread Paul
--- "Yacketta, Ronald" <[EMAIL PROTECTED]> wrote: Hmm... some of this code looks familiar, lol > $lookFor="Test App Finished|Fault > 2-0|ORA-|Bind|SystemError|SystemException|Communication|ORBA|Get Q > Error"; > opendir DIR, "../logs/set1/" or die "Can't open ../logs/set1/: $!"; > @allFiles

Re: HELP WITH AWK2PERL SCRIPT

2001-06-26 Thread Randal L. Schwartz
> "Randal" == Randal L Schwartz <[EMAIL PROTECTED]> writes: Randal> while (<>) { Randal> @f = split ' ', $_; Randal> next unless $f[2] < 0.8 and $f[3] =~ /\./; Randal> print; Randal> } Argh. Forgot about the $[ = 1 in the translation. Replace 2 with 1 and 3 with 2

Re: curly braces

2001-06-26 Thread Brett W. McCoy
On Tue, 26 Jun 2001, Silvio Luis Leite Santana wrote: > CODE 2 - DOESN'T WORK > (should it work, I'd wish to put more > than one command inside the curly braces) > > $bissexto = ; > chop($bissexto); > $bissexto and { print "OK\n"; }; > print "end\n"; I think what you really want is $bissexto &&

Re: :Graph - Script archive for beg.

2001-06-26 Thread Elaine -HFB- Ashton
Prabhu, Vrunda P (UMC-Student) [[EMAIL PROTECTED]] quoth: *> *>>Another question, would anyone be interested in helping me create a *>>script/snippet archive geared towards newbies? *> *>I would be interested in careting something like that. What did you have in *>mind? CPAN has a scripts archi

Re: curly braces

2001-06-26 Thread Jeff 'japhy' Pinyan
On Jun 26, Silvio Luis Leite Santana said: >Why does code 1 work, but code 2 doesn't? >(the diference is the ; after print) In the first code, Perl thinks you're constructing a hash reference. In the second code, Perl sees a block where it expects an expression. >After all, is it posible or no

Re: HELP WITH AWK2PERL SCRIPT

2001-06-26 Thread Jeff 'japhy' Pinyan
On Jun 26, Pedro A Reche Gallardo said: >eval 'exec /usr/sbin/perl -S $0 ${1+"$@"}' >if $running_under_some_shell; > # this emulates #! processing on NIH machines. > # (remove #! line above if indigestible) That is just for OSs that can't handle #! lines. >eval '$'.$1.'$2;' while $ARGV[

Re: HELP WITH AWK2PERL SCRIPT

2001-06-26 Thread Randal L. Schwartz
> "Pedro" == Pedro A Reche Gallardo <[EMAIL PROTECTED]> writes: Pedro> Hi all, I have a file that it looks as it follows Pedro> 1 0.057 M M - M Pedro> 2 0.819 R R - R Pedro> 3 0.731 V V - V Pedro> 4 1.708 K

curly braces

2001-06-26 Thread Silvio Luis Leite Santana
Please Why does code 1 work, but code 2 doesn't? (the diference is the ; after print) After all, is it posible or not to put a block in place of a expression? Thanks in advance Silvio CODE 1 - WORK $bissexto = ; chop($bissexto); $bissexto and { print "OK\n" }; print "end\n"; CODE 2 - DOESN'T

HELP! this has me rather ummm PISSED ;)

2001-06-26 Thread Yacketta, Ronald
Folks, I have a process that has been working for a week now. ran several test 0 problems now out of the GD blue it has stop functioning. the following should 1) suck in all the files in a dor 2) split them into 3 arrays (logger files only) 3) run a forked egrep on each array of files the resul

HELP WITH AWK2PERL SCRIPT

2001-06-26 Thread Pedro A Reche Gallardo
Hi all, I have a file that it looks as it follows 1 0.057 M M - M 2 0.819 R R - R 3 0.731 V V - V 4 1.708 K R - c 5 1.070 G G - t 6 1.611 I M -

Problem reading info

2001-06-26 Thread Craig S Monroe
Hello all, I am writing a script that opens up a telnet session with a specific device, and issues a command. I would then like to look through each of the lines and look for the target line by matching a pattern. Once this is done, I would like to split the values and assign the to variables. T

Re: package verification

2001-06-26 Thread Paul Johnson
On Tue, Jun 26, 2001 at 12:17:50PM -0400, Richard J. Barbalace wrote: > Trying to do this gives a warning. For example: > package MyPackage; > use Flakey; > . > package MyPackage::A; > . > package MyPackage::C; > # Test if Flakey is compatible with MyPa

Re: :Graph - Script archive for beg.

2001-06-26 Thread Casey West
On Tue, Jun 26, 2001 at 01:24:30PM -0500, Prabhu, Vrunda P (UMC-Student) wrote: : : : >Another question, would anyone be interested in helping me create a : >script/snippet archive geared towards newbies? : : I would be interested in careting something like that. What did you have in : mind?

RE: :Graph - Script archive for beg.

2001-06-26 Thread Prabhu, Vrunda P (UMC-Student)
>Another question, would anyone be interested in helping me create a >script/snippet archive geared towards newbies? I would be interested in careting something like that. What did you have in mind?

Re: Checking Free Disk Space in Win32

2001-06-26 Thread Aaron Petry
Thank you to everyone who replied! That was way quicker than I had hoped. I saw (in a Google search) the reference to Perl for System Administration at O'Reilly's Safari site. I've got the Camel book, but I couldn't find anything there. Thanks for all the help!

re: Checking Free Disk Space in Win32

2001-06-26 Thread Kipp, James
There is a script at the Roth site (same place U get Win32::AdminMisc) called diskpig.pl that I think is exactly what U are looking for. If U are going to be doing alot of Win32 Admin stuff, it would be to your advantage to learn Win32::AdminMisc. It can do so many things and the interface is pre

Re: connecting to a server to get file data...

2001-06-26 Thread Casey West
On Tue, Jun 26, 2001 at 10:56:51AM -0700, Chirag Patel wrote: : hello, : i would like write a script that, when executed from a win32 machine, : processes data that is archived on a Linux server. Is there a way of : connecting to the server to collect data from files other than Net::Telnet? : tha

Re: Checking Free Disk Space in Win32

2001-06-26 Thread Chris Hedemark
BTW I just recently bought this book ("Perl for System Administration", the otter book from O'Reilly). You really otter get it (duck). It's got tons of good stuff for managing Macs, Win32 systems, *NIX, etc. and goes about explaining how to do things on each of the different platforms. Chris He

Re: Variable scope

2001-06-26 Thread Me
> > I could not get the following sub to work until > > I had to move $emailLog inside the sub to get this > > to work on the server. > > > > What did I miss or not understand? More on that in a moment. First... > Try putting a "my" (without quotes) before the variable. > What that will do

Re: Checking Free Disk Space in Win32

2001-06-26 Thread Chris Hedemark
# From "Perl for System Administration" use Win32::AdminMisc; ($total,$free) = Win32::AdminMisc::GetDriveSpace("c:\\"); print "$free bytes of $total bytes free\n"; # Good luck, hope that helps! # -Chris - Original Message - From: "Aaron Petry" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]

Re: RTFM (was chomp ?)

2001-06-26 Thread Casey West
On Tue, Jun 26, 2001 at 10:13:50AM -0500, Humberto Varela wrote: : Asking for help sort of requires that you've tried : : phase one (Trying to solve the problem yourself) and : : phase two (searching the internet for a solution, after all www.google.com is a :wonderful thing) and were just ab

connecting to a server to get file data...

2001-06-26 Thread Chirag Patel
hello, i would like write a script that, when executed from a win32 machine, processes data that is archived on a Linux server. Is there a way of connecting to the server to collect data from files other than Net::Telnet? thanks, chirag.

  1   2   3   >