Regex needed.

2003-01-21 Thread George P.
Hi, my ($str) = "HI, HELLO, GREETINGS"; my ($reg) = "(BYE|HI|CIAO)"; if ($str =~ /$reg/) { print "Exists in $str\n"; } The above code, will return true if BYE, HI or CIAO exists in $str. I want a regex to be put in $reg, which will return true if neither BYE, HI nor CIAO exists in $str.

Re: My, our, local

2003-01-21 Thread John W. Krahn
Carlos Diaz wrote: > > Can anyone explain in simple terms the difference between the three (my, > our, local). Especially the difference between my and local. Thanks... local is a leftover from pre-Perl5 versions. It is used on package (global) variables and does not define them it only affects

Re: translation and its attachment

2003-01-21 Thread R. Joseph Newton
It's a pgp [Pretty Good Privacy] signature file--used to assure that this post is indeed from: Mat Harris OpenGPG Public Key ID: C37D57D9. Netscape Messenger 4.x doesn't seem to know what to do with it when I try to open it.. The plug-in finder found no appropriate plug-ins,

Re: Upload - File Lock question

2003-01-21 Thread Mkrous
Thank you all for your replies, >Play around with *FILEHANDLE. For example: >open FILEHANDLE, ">blah.txt"; >&closeFile( *FILEHANDLE ); >sub closeFile { > my $fh = shift; > print $fh "I closed you.\n"; > close $fh; >} Still I was not able to delete the file. >you don't need to lock the fi

Path to script

2003-01-21 Thread Brian Ling
Hi all, I have the following bit of code that works out the directory path to the currently executing script. My $path = $0; $path =~ s#(^/.+/).+$#$1# ; This works but doesn't make me happy, is there a better way? Thanks Brian BBCi at http://www.bbc.co.uk/ This e-mail (and any attachment

Re: Upload - File Lock question

2003-01-21 Thread Mark Goland
The problem is that you this lock is not mandetory, if you really really want to lock the file, you have to set mendatory lock's. You have to setup a system in which a user will be able to delete/create a file. you can setup semaphore scheme. Mark - Original Message - From: "Mkrous" <[EM

RE: Path to script

2003-01-21 Thread NYIMI Jose (BMB)
C:\>perldoc File::Basename NAME fileparse - split a pathname into pieces basename - extract just the filename from a path dirname - extract just the directory from a path SYNOPSIS use File::Basename; ($name,$path,$suffix) = fileparse($fullname,@suffixlist) fi

Re: Path to script

2003-01-21 Thread Mark Goland
my $path=`pwd` on *nix my $path=`cd` on win* - Original Message - From: "Brian Ling" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, January 21, 2003 4:25 AM Subject: Path to script > Hi all, > > I have the following bit of code that works out the directory path to > the cur

RE: Path to script

2003-01-21 Thread NYIMI Jose (BMB)
Have a look to : http://search.cpan.org/author/LIBERTY/Cwd-2.06/Cwd.pm José. > -Original Message- > From: Mark Goland [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, January 21, 2003 10:42 AM > To: Brian Ling > Cc: perl > Subject: Re: Path to script > > > my $path=`pwd` on *nix > my $pat

RE: Path to script

2003-01-21 Thread Brian Ling
Thanks for that, I'll go with the File::Basename option as I may need to change the 'pwd' by the time the call is made. Brian -Original Message- From: NYIMI Jose (BMB) [mailto:[EMAIL PROTECTED]] Sent: 21 January 2003 09:48 To: Mark Goland; Brian Ling Cc: perl Subject: RE: Path to scri

RE: how to print array element & count

2003-01-21 Thread Eri Mendz
Dear All, I'm greatly overwhelmed by your quick help to my problem. Here's the corrected code: #!/usr/bin/perl -w use strict; # filename: reverse_string.pl # editor: # VIM - Vi IMproved 6.1 # description: get user input and reverse input print "Please enter any string, to quit press Ctrl-Z:\

RE: Path to script

2003-01-21 Thread NYIMI Jose (BMB)
> -Original Message- > From: Brian Ling [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, January 21, 2003 10:59 AM > To: NYIMI Jose (BMB); Mark Goland > Cc: perl > Subject: RE: Path to script > > > Thanks for that, > > I'll go with the File::Basename option as I may need to > change the 'pw

Re: Path to script

2003-01-21 Thread Rob Dixon
"Brian Ling" wrote: > Hi all, > > I have the following bit of code that works out the directory path to > the currently executing script. > > My $path = $0; > $path =~ s#(^/.+/).+$#$1# ; > > This works but doesn't make me happy, is there a better way? If you're doing other path manipulation in the

RE: Path to script

2003-01-21 Thread Paul Johnson
Brian Ling said: > Thanks for that, > > I'll go with the File::Basename option as I may need to change the 'pwd' > by the time the call is made. What you really want is the FindBin module. perldoc FindBin >> > I have the following bit of code that works out the >> directory path to >> > the cu

Re: how to print array element & count

2003-01-21 Thread Rob Dixon
"Eri Mendz" <[EMAIL PROTECTED]> wrote in message 3E2D45F0.14555.14A0579@localhost">news:3E2D45F0.14555.14A0579@localhost... > chomp(my @input = ); > my $total_elements = scalar(@input); Assigning to a scalar variable puts the right-hand-side in scalar context anyway. my $total_elements = @in

RE: Path to script

2003-01-21 Thread Brian Ling
Yep I did really want FindBin, as I did not know the possible problems with $0, -Original Message- From: NYIMI Jose (BMB) [mailto:[EMAIL PROTECTED]] Sent: 21 January 2003 10:13 To: Brian Ling; Mark Goland Cc: perl Subject: RE: Path to script > -Original Message- > From: Brian

Re: how to print array element & count

2003-01-21 Thread John W. Krahn
Eri Mendz wrote: > > Dear All, > > I'm greatly overwhelmed by your quick help to my problem. > Here's the corrected code: > > #!/usr/bin/perl -w > use strict; > > # filename: reverse_string.pl > # editor: # VIM - Vi IMproved 6.1 > # description: get user input and reverse input > > print "Plea

RE: Nested hash creation help !

2003-01-21 Thread Scot Needy
Thanks Jose! I have the hash created and now can see the values using Data::Dumper but now I an having trouble walking the hashtree. Trying to walk back out to each leaf value in the tree. Hash def $time=>{$custname}{$custsub}{$site}{$YYMMDDay}{'start'} = $hhmmsss; This doesn't seem to get any

Re: Adding new path to @INC

2003-01-21 Thread Jon
or #! /usr/bin/perl -w use lib qw(/path/to/your/stuff) - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Monday, January 20, 2003 4:14 PM Subject: RE: Adding new path to @INC Sure. #!/usr/local/bin/perl BEGIN { unshift (@INC, "Your/p

Re: Perldoc?

2003-01-21 Thread Alan C.
Kevin Old wrote: have noticed that the perldoc command isn't availableI've looked for Doesn't that one use man ? man html::parser etc. -- Alan. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

IO::Getline Methode

2003-01-21 Thread Angerstein
...already searched cpan. Has anybody an idea where I can get the Modul or Methode IO::Getline or IO::Getlines Are they only in Perl 5.8? (I am using 5.0) Thx, Bastian -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

deleting files

2003-01-21 Thread Piotr
Hi all, I am new to perl and I try to remove file with it, but I don't known how :( I find modules File::Copy, File::Find, but not File::Delete :( How can I do this ? Peter ***r-e-k-l-a-m-a** Chcesz oszczedzic na kosztach obslugi bankowej ? mBIZNES - konto dla fi

RE: deleting files

2003-01-21 Thread NYIMI Jose (BMB)
C:\>perldoc -f unlink unlink LIST unlink Deletes a list of files. Returns the number of files successfully deleted. $cnt = unlink 'a', 'b', 'c'; unlink @goners; unlink <*.bak>; Note: "unlink" will not delete director

Duplicate Mail

2003-01-21 Thread Paul Kraus
I just set up a new pc. For some reason I am getting double mail from the list. Any ideas? It not just the mail where "my" email address is in the header but every single message period. Paul -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Duplicate Mail

2003-01-21 Thread Paul Kraus
Was a double filter. Fixed. -Original Message- From: Paul Kraus [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 21, 2003 8:22 AM To: Perl Subject: Duplicate Mail I just set up a new pc. For some reason I am getting double mail from the list. Any ideas? It not just the mail where "my"

RE: My, our, local

2003-01-21 Thread wiggins
On Mon, 20 Jan 2003 21:11:56 -0600, "Carlos Diaz" <[EMAIL PROTECTED]> wrote: > Can anyone explain in simple terms the difference between the three (my, > our, local). Especially the difference between my and local. Thanks... > > CD I know you ask

RE: Regex needed.

2003-01-21 Thread Dan Muey
> Hi, > > my ($str) = "HI, HELLO, GREETINGS"; > my ($reg) = "(BYE|HI|CIAO)"; > > if ($str =~ /$reg/) > { print "Exists in $str\n"; } > > The above code, will return true if BYE, HI or CIAO exists > in $str. > I want a regex to be put in $reg, which will return true > if neither BYE, HI n

Re: slurping function like shell

2003-01-21 Thread Harry Putnam
Thanks for tips posters.. "John W. Krahn" <[EMAIL PROTECTED]> writes: > You should _always_ verify that the file opened successfully. > > open(FILE,">somefile") or die "Cannot open 'somefile' $!"; Not being argumentative here but I've seen this said before. Not really sure why it is import

Re: slurping function like shell

2003-01-21 Thread Ben Siders
You should always perform all error checking in any language to ensure that your program, if it fails, declines gracefully. One of the greatest shortcomings of C is that error checking is entirely manual, and you simply must, in every real-world application, check the return value of almost ev

RE: My, our, local

2003-01-21 Thread Paul Kraus
Great article. Cleared up all of my confusion. However it did not touch on "our". Anyone care to explain what its used for. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 21, 2003 8:40 AM To: Carlos Diaz; [EMAIL PROTECTED] Subject: RE: My, ou

Re: slurping function like shell

2003-01-21 Thread Harry Putnam
"John W. Krahn" <[EMAIL PROTECTED]> writes: > You should probably be using POSIX::strftime instead which is simpler > and faster. > > use POSIX 'strftime'; > > print FILE strftime( "An extra numeral <%D %T %w> appears\n", > localtime ); Probably coming off like some kind of carpy here but I'm

Re: slurping function like shell

2003-01-21 Thread Harry Putnam
"John W. Krahn" <[EMAIL PROTECTED]> writes: > You shouldn't use ampersands unless you need the different behavior they > provide. John, I asked for a documentation pointer on this in a previous post that hasn't hit the server here yet, but don't bother with that please. I found the info in perlf

Re: slurping function like shell

2003-01-21 Thread Ben Siders
strftime is an interface to a C function of the same name. It's a fairly common function in many applications that have to deal with dates and times. You may not need it here, but it's not a bad idea to get a little familiar with it. For the life of me, I can't ever remember all the format c

Re: slurping function like shell

2003-01-21 Thread Harry Putnam
Ben Siders <[EMAIL PROTECTED]> writes: > You should always perform all error checking in any language to ensure Well thanks Ben. That was nice full explanation and makes a lot of sense. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: My, our, local

2003-01-21 Thread Bob Showalter
Paul Kraus wrote: > Maybe I am misunderstanding but that seems to be the exact same thing > my does. No. my() creates a new variable. our() refers to a global variable. Try this: use strict; print "Global \$main::foo is at ", \$main::foo, "\n"; our $foo = 'One'; print "a: addr=", \$foo,

Re: My, our, local

2003-01-21 Thread Rob Dixon
Paul Kraus wrote: > Great article. Cleared up all of my confusion. However it did not > touch on "our". Anyone care to explain what its used for. Hi Paul. An 'our' variable has the same visibility as a 'my' variable declared in the same place, i.e. through to the end of the current lexical scope

other new news ???

2003-01-21 Thread km
Hi all, i have head that switch is introduced from perl 5.8. what are all the other new additions to the perl??? enlighten me -- km -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: other new news ???

2003-01-21 Thread Perry, Alan
[EMAIL PROTECTED] wrote: > Hi all, > > i have head that switch is introduced from perl 5.8. what are all the > other new additions to the perl??? For a complete list of changes, go to: http://dev.perl.org/perl5/news/2002/07/18/580ann/perldelta.html Alan -- To unsubscribe, e-mail: [EMAIL PROTE

Apples, Carrots, and Pecans

2003-01-21 Thread Bob Williams
I appreciate the input on my recent post for comparing apples and oranges. Got it working great! Thanks. Now for some more food. I have a directory: food. In the directory, there are three files: apple, carrot, pecan. Each file has three descriptions each. Apple has: fruit red round (as its three

RE: Apples, Carrots, and Pecans

2003-01-21 Thread Dan Muey
> I appreciate the input on my recent post for comparing apples > and oranges. Got it working great! Thanks. Now for some more food. > > I have a directory: food. In the directory, there are three > files: apple, carrot, pecan. Each file has three descriptions How are the descriptions formatte

Current package name

2003-01-21 Thread Beau E. Cox
Hi - How do I get the current package name? For example, if I have a module that starts with: package Beau::Cool::Stuff; ... and I want to give an error (die) later in this module: ... die "invalid stuff passed to Beau::Cool::Stuff::function\n"; ... where is the 'package name variable' so I do

RE: Current package name

2003-01-21 Thread wiggins
__PACKAGE__ 3rd Camel, page 68, Literals http://danconia.org On Tue, 21 Jan 2003 08:15:09 -1000, "Beau E. Cox" <[EMAIL PROTECTED]> wrote: > Hi - > > How do I get the current package name? For example, > if I have a module that starts with:

a split(); question

2003-01-21 Thread justino berrun
#hello, is there a way to split a string between a digit and character #without losing the digit or the character #Any help would be very appreciated $string='hello...4546perl...2366Pogrammers..3435'; #e.g. would make three new strings @newstrings=split(/(\d)([a-zA-Z])/,$string);

Re: Current package name

2003-01-21 Thread Janek Schleicher
On Tue, 21 Jan 2003 08:15:09 +, Beau E. Cox wrote: > How do I get the current package name? For example, > if I have a module that starts with: It's in __PACKAGE__ Greetings, Janek -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: a split(); question

2003-01-21 Thread Janek Schleicher
On Wed, 22 Jan 2003 02:46:27 +0800, Justino Berrun wrote: > #hello, is there a way to split a string between a digit and character > #without losing the digit or the character > #Any help would be very appreciated > > $string='hello...4546perl...2366Pogrammers..3435'; #e.g. would make three

Re: how to print array element & count

2003-01-21 Thread R. Joseph Newton
"... foreach(1..$total_elements){ print "\t\[$_\] my $input[$_ - 1 ]\n"; } ...Why did scalar $input in the foreach loop "works" without predeclaring it with my?" --Eri HI Eri, The my is probably not doing what you think it is. Otherwise it would constitute a redeclaration error. My guess

RE: a split(); question

2003-01-21 Thread Wagner, David --- Senior Programmer Analyst --- WGO
justino berrun wrote: > #hello, is there a way to split a string between a digit and character > #without losing the digit or the character > #Any help would be very appreciated > > $string='hello...4546perl...2366Pogrammers..3435'; #e.g. would > make three new strings > > @newstrings=split(

Need help parsing a DN

2003-01-21 Thread Paul Harwood
What would be the best method to parse the following DN? I just want the first part of this DN so I can create a server list into an array (EX-MSG-01, EXMSG-02 etc). I've tried using SPLIT but I am not sure how to get the first part of the text I want. Any help appreciated. CN=EX-MSG-01,CN=

RE: Current package name

2003-01-21 Thread Beau E. Cox
__THANKS__ ;) > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, January 21, 2003 8:27 AM > To: Beau E. Cox; 'Beginners > Subject: RE: Current package name > > > __PACKAGE__ > > 3rd Camel, page 68, Literals > > http://danconia.org > > > -

RE: how to print array element & count

2003-01-21 Thread Bob Showalter
R. Joseph Newton wrote: > "... > foreach(1..$total_elements){ > print "\t\[$_\] my $input[$_ - 1 ]\n"; > } > ...Why did scalar $input in the foreach loop > "works" without predeclaring it with my?" --Eri > > HI Eri, > > The my is probably not doing what you think it is. Otherwise > it would

RE: Current package name

2003-01-21 Thread Bob Showalter
Beau E. Cox wrote: > Hi - > > How do I get the current package name? For example, > if I have a module that starts with: > > package Beau::Cool::Stuff; > ... > > and I want to give an error (die) later in this module: > > ... > die "invalid stuff passed to Beau::Cool::Stuff::function\n"; ... >

RE: Need help parsing a DN

2003-01-21 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Paul Harwood wrote: > What would be the best method to parse the following DN? I just want > the first part of this DN so I can create a server list into an array > (EX-MSG-01, EXMSG-02 etc). I've tried using SPLIT but I am not sure > how to get the first part of the text I want. Any help appreciat

My list declaration

2003-01-21 Thread Paul Kraus
Can you define a list with my? I tried my ($var1, $var2) = 'something','something else'; I have also tried my ($var1, $var2 = 'something','something else'); Thanks. Paul -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: slurping function like shell

2003-01-21 Thread R. Joseph Newton
" ... > open(FILE,">somefile") or die "Cannot open 'somefile' $!"; Not being argumentative here but I've seen this said before. Not really sure why it is important. I mean why is the open action singled out for this protection. It seems other actions could also cause a misfired script? ..."

Re: slurping function like shell

2003-01-21 Thread John W. Krahn
Harry Putnam wrote: > > "John W. Krahn" <[EMAIL PROTECTED]> writes: > > > You shouldn't use ampersands unless you need the different behavior they > > provide. > > John, > I asked for a documentation pointer on this in a previous post that > hasn't hit the server here yet, but don't bother with

RE: My list declaration

2003-01-21 Thread Bob Showalter
Paul Kraus wrote: > Can you define a list with my? > > I tried > my ($var1, $var2) = 'something','something else'; > I have also tried > my ($var1, $var2 = 'something','something else'); Close! You need: my ($var1, $var2) = ('something', 'something else'); -- To unsubscribe, e-mail: [EMAI

RE: My list declaration

2003-01-21 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Paul Kraus wrote: > Can you define a list with my? > > I tried > my ($var1, $var2) = 'something','something else'; > I have also tried > my ($var1, $var2 = 'something','something else'); > > Thanks. > > Paul When you say list, then hash comes to mind. So to do a list then you need key and dat

RE: My list declaration

2003-01-21 Thread wiggins
On Tue, 21 Jan 2003 14:17:19 -0500, "Paul Kraus" <[EMAIL PROTECTED]> wrote: > > Can you define a list with my? > > I tried > my ($var1, $var2) = 'something','something else'; > I have also tried > my ($var1, $var2 = 'something','something else

Tie? Why?

2003-01-21 Thread Rob Richardson
Greetings! I am beginning to seriously consider what I am going to have to do to wrestle some reasonable amount of organization out of the unbelievable pile of spaghetti I've been trying to update. I managed to add what I needed; now I'm going to go back and do it the way it should have been done

RE: slurping function like shell

2003-01-21 Thread Bob Showalter
R. Joseph Newton wrote: > The die function can be very useful > working in console mode, but it is hell for CGI debugging. > Since errors go into the server error log, which tends to be > accessible only to the system admin, it can be damn near > useless to have die statements in a CGI script. You

Win32 File Attribs Example.

2003-01-21 Thread Michael Kingsbury
Does anyone have an example of determinting the file attibute bits of a file? I can get the bits, but have no easy way of determining what's what. I'm using the Win32::File::GetAttributes function. -mike -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

Pack syntax

2003-01-21 Thread Paul Kraus
I am creating a simple database that needs to contain 3 fields. Date, order number, tracking number. I figured I would use a dbmhash and use pack to get the data in. So my hash would be %hash{tracking_number}=$packeddata. The date and order number are both strings. So using the information I rece

Re: Tie? Why?

2003-01-21 Thread John W. Krahn
Rob Richardson wrote: > > Greetings! Hello, > I am beginning to seriously consider what I am going to have to do to > wrestle some reasonable amount of organization out of the unbelievable > pile of spaghetti I've been trying to update. I managed to add what I > needed; now I'm going to go back

RE: Pack syntax

2003-01-21 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Paul Kraus wrote: > I am creating a simple database that needs to contain 3 fields. > Date, order number, tracking number. > > I figured I would use a dbmhash and use pack to get the data in. > So my hash would be %hash{tracking_number}=$packeddata. > > The date and order number are both strings.

Re: other new news ???

2003-01-21 Thread Rob Dixon
[EMAIL PROTECTED] wrote: > Hi all, > > i have head that switch is introduced from perl 5.8. what are all the > other new additions to the perl??? > > enlighten me -- Hi. Take a look at "perldelta - what is new for perl v5.8.0" here: http://dev.perl.org/perl5/news/2002/07/18/580ann/perldelta.

doubt in pattern matching

2003-01-21 Thread kasi ramanathen
dear friends: i have a simple doubts in reguler exepration see the the passage that follows is stored in a variable by name v. in the fifth line see the words like this "Next 20 ^ " now i want delete all the charecter before ^- sign in my variable v. shall i use find and replace to find all th

Re: a split(); question

2003-01-21 Thread Rob Dixon
Justino Berrun wrote: > #hello, is there a way to split a string between a digit and character > #without losing the digit or the character > #Any help would be very appreciated > > $string='hello...4546perl...2366Pogrammers..3435'; #e.g. would > make three new strings > > @newstrings=split(/(\

RE: Pack syntax

2003-01-21 Thread Paul Kraus
You are of course correct. After some digging I seems that the problem was in my unpack statement. When I actually checked the packed variable all the data was there. I was doing .. My ($a,$b) = unpack("A A",$buffer); When I added ... Unpack "A* A*" It sort of worked. It just unloads $buffer i

Re: Need help parsing a DN

2003-01-21 Thread Rob Dixon
Paul Harwood wrote: > What would be the best method to parse the following DN? I just want > the first part of this DN so I can create a server list into an array > (EX-MSG-01, EXMSG-02 etc). I've tried using SPLIT but I am not sure > how to get the first part of the text I want. Any help appreciat

RE: doubt in pattern matching

2003-01-21 Thread Dan Muey
> dear friends: Howdy > > i have a simple doubts in reguler exepration see the the > passage that follows is stored in a variable by name v. in > the fifth line see the words like this "Next 20 ^ " now i > want delete all the charecter before ^- sign in my variable v. > > shall i use find and

Windows XP - xemacs - Color syntax

2003-01-21 Thread Paul Kraus
I have just installed xemacs on my windows xp machine. I am working in mode cperl-mode. From my understanding it is supposed to have syntax highlighting. Is this untrue of the windows port? Do I need to turn it on somewhere? Paul Kraus -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

RE: Pack syntax

2003-01-21 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Paul Kraus wrote: > You are of course correct. After some digging I seems that the problem > was in my unpack statement. When I actually checked the packed > variable all the data was there. > > I was doing .. My ($a,$b) = unpack("A A",$buffer); > When I added ... Unpack "A* A*" > It sort of w

Re: My list declaration

2003-01-21 Thread Rob Dixon
Bob Showalter wrote: > Paul Kraus wrote: >> Can you define a list with my? >> >> I tried >> my ($var1, $var2) = 'something','something else'; >> I have also tried >> my ($var1, $var2 = 'something','something else'); > > Close! You need: > >my ($var1, $var2) = ('something', 'something else');

RE: Pack syntax

2003-01-21 Thread Paul Kraus
I have two text files that are exported from our shipping computers each night. One is FedEx and contains a space delimitated file with two fields. OrderNumber TrackingNumber The other is UPS and contains a CSV file with two fields. "OrderNumber","TrackingNumber" I wanted to have a script that w

RE: Tie? Why?

2003-01-21 Thread Bob Showalter
Rob Richardson wrote: > Greetings! > > I am beginning to seriously consider what I am going to have to do to > wrestle some reasonable amount of organization out of the unbelievable > pile of spaghetti I've been trying to update. I managed to add what I > needed; now I'm going to go back and do i

Re: My, our, local

2003-01-21 Thread R. Joseph Newton
"... Unlike 'my', however, it is a permanent package variable and its value will be retained across calls to a subroutine ..." --Rob Hi Rob, So does this make it equivalent to a C-style static variable? I've been trying to test it, and it seems to be impossible to even declare it using strict.

Re: Win32 File Attribs Example.

2003-01-21 Thread Rob Dixon
Michael Kingsbury wrote: > Does anyone have an example of determinting the file attibute bits of > a file? I can get the bits, but have no easy way of determining > what's what. I'm using the Win32::File::GetAttributes function. > Hi Mike. The bitmasks COMPRESSED, DIRECTORY, HIDDEN, NORMAL, OFF

RE: My list declaration

2003-01-21 Thread Paul Kraus
My ($var1,$var2) = ('something','something else'); Was exactly what I wanted. :) -Original Message- From: Rob Dixon [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 21, 2003 3:40 PM To: [EMAIL PROTECTED] Subject: Re: My list declaration Bob Showalter wrote: > Paul Kraus wrote: >> Can

RE: Pack syntax

2003-01-21 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Paul Kraus wrote: > I have two text files that are exported from our shipping computers > each night. > > One is FedEx and contains a space delimitated file with two fields. > OrderNumber TrackingNumber > > The other is UPS and contains a CSV file with two fields. > "OrderNumber","TrackingNumber"

RE: Pack syntax

2003-01-21 Thread Paul Kraus
Thanks! I like to make more work for myself. -Original Message- From: Wagner, David --- Senior Programmer Analyst --- WGO [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 21, 2003 3:56 PM To: '[EMAIL PROTECTED]'; Wagner, David --- Senior Programmer Analyst --- WGO; 'Perl' Subject: RE: P

Re: My, our, local

2003-01-21 Thread R. Joseph Newton
"... Hi Paul. n 'our' variable has the same visibility as a 'my' variable declared in the same place, i.e. through to the end of the current lexical scope (block or file). Unlike 'my', however, it is a permanent package variable and its value will be retained across calls to a subroutine (unless m

Re: a split(); question

2003-01-21 Thread John W. Krahn
Rob Dixon wrote: > > Justino Berrun wrote: > > #hello, is there a way to split a string between a digit and character > > #without losing the digit or the character > > #Any help would be very appreciated > > > > $string='hello...4546perl...2366Pogrammers..3435'; #e.g. would > > make three new

Re: My, our, local

2003-01-21 Thread Rob Dixon
R. Joseph Newton wrote: > "... > Unlike 'my', however, it is a permanent > package variable and its value will be retained across calls to a > subroutine ..." --Rob > > Hi Rob, > > So does this make it equivalent to a C-style static variable? Sort of, but beware that any occurrence of 'our $var'

RE: Pack syntax

2003-01-21 Thread wiggins
On Tue, 21 Jan 2003 15:59:12 -0500, "Paul Kraus" <[EMAIL PROTECTED]> wrote: > Thanks! > > I like to make more work for myself. In that case you could always just create your hash/array data structure and then use Storable and Freezethaw :-)

max floating point number

2003-01-21 Thread Konrad Foerstner
Hi, does anybody know the maximum value of floating point numbers I could use in Perl? Konrad -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

looking for a string in multiple files

2003-01-21 Thread Marco
What I'm trying to achieve is the following: I have an ASCII text file (zonelist.input) for input which contains a domainname (that is i.e. foo.com) on each line ( a total of about 230 lines are in this file). Furthermore, I have 3 other text files. I'm looking for a method to read each line from

RE: My, our, local

2003-01-21 Thread david
Bob Showalter wrote: > Paul Kraus wrote: >> Maybe I am misunderstanding but that seems to be the exact same thing >> my does. > > No. my() creates a new variable. our() refers to a global variable. not sure what you mean by that. 'our' does create new variable if that variable does NOT already

Regular Expression - Search for Form Feed

2003-01-21 Thread Paul Kraus
How can I search for form feed. I have tried /\f/ But I realize that the regexp engine doesn't use \f -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Regular Expression - Search for Form Feed

2003-01-21 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Paul Kraus wrote: > How can I search for form feed. I have tried > > /\f/ > > But I realize that the regexp engine doesn't use \f But it does! page 72, Mastering Regular Expressions, Friedl. Usually maps to ASCII character, 014 octal. Wags ;) *

RE: My, our, local

2003-01-21 Thread Bob Showalter
david wrote: > Bob Showalter wrote: > > > Paul Kraus wrote: > > > Maybe I am misunderstanding but that seems to be the exact same > > > thing my does. > > > > No. my() creates a new variable. our() refers to a global variable. > > not sure what you mean by that. 'our' does create new variable if

RE: My, our, local

2003-01-21 Thread david
Bob Showalter wrote: > I think you're missing the point. Any reference to the symbol anywhere in > the program "creates" the variable, in the sense you indicated here. > > For example: > >package Foo; >our $x = 1; >print "$_\n" for keys %Foo::; >our $y = 1; > > This prints: >

Re: max floating point number

2003-01-21 Thread Wiggins d'Anconia
Konrad Foerstner wrote: Hi, does anybody know the maximum value of floating point numbers I could use in Perl? This is likely either system architecture (aka 32 bit vs. 64 bit) and/or memory size dependent. And then there is the whole signed vs. unsigned thing, but all of that just makes my

Re: IO::Getline Methode

2003-01-21 Thread Wiggins d'Anconia
Angerstein wrote: ...already searched cpan. Has anybody an idea where I can get the Modul or Methode IO::Getline or IO::Getlines Are they only in Perl 5.8? (I am using 5.0) This appears to be a method(s) included as part of the IO::Handle module, which I believe became available around 5.6

Re: My list declaration

2003-01-21 Thread Janek Schleicher
On Tue, 21 Jan 2003 14:17:19 +, Paul Kraus wrote: > Can you define a list with my? > > I tried > my ($var1, $var2) = 'something','something else'; > I have also tried > my ($var1, $var2 = 'something','something else'); Of course, but it like with mathematics. If at the left side of a = is

Re: looking for a string in multiple files

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

Bareword Constant from Package giving problems with use strict....

2003-01-21 Thread Michael Kingsbury
How do I use a (known) Bareword constant from a package when strict's on? -mike -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Bareword Constant from Package giving problems with use stric t....

2003-01-21 Thread Toby Stuart
> -Original Message- > From: Michael Kingsbury [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, January 22, 2003 12:28 PM > To: [EMAIL PROTECTED] > Subject: Bareword Constant from Package giving problems with use > strict > > > How do I use a (known) Bareword constant from a package wh

Re: Bareword Constant from Package giving problems with use strict....

2003-01-21 Thread simran
not sure what you mean... but perhaps the following might help: * use constant ABC => 'this is some text'; * use vars ... On Wed, 2003-01-22 at 12:28, Michael Kingsbury wrote: > How do I use a (known) Bareword constant from a package when strict's on? > > -mike -- To unsubscribe, e-mai

Re: Bareword Constant from Package giving problems with use strict....

2003-01-21 Thread Michael Kingsbury
The Win32::File uses ARCHIVE, READONLY, SYSTEM, HIDDEN, etc as constants for use with the file attribute types. However, with use strict, perl barfs due to a bareword. On 22 Jan 2003, simran wrote: > not sure what you mean... > > but perhaps the following might help: > > * use constant

Re: Bareword Constant from Package giving problems with use strict....

2003-01-21 Thread david
Michael Kingsbury wrote: > The Win32::File uses ARCHIVE, READONLY, SYSTEM, HIDDEN, etc as constants > for use with the file attribute types. However, with use strict, perl > barfs due to a bareword. > they should be used the same way vars, subs are used. if they are exported, just use them. if

  1   2   >