How to translate "\\server\alias\*****\file\" with $folder?

2002-07-14 Thread chris
I have a mask in "\\server\alias\*\file\". The asterisks will be assigned the value of a variable. Any ideas? my $folder = "foldername"; my string1 = "\\server\alias\*\file\"; # how to make string1 = \\server\alias\foldername\file\ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For addit

RE: How to translate "\\server\alias\*****\file\" with $folder?

2002-07-14 Thread Beau E. Cox
Hi - This works: my $folder = "foldername"; my $string1 = "server\\alias\\*\\file\\"; my $result = $string1; $result =~ s/\*\*\*\*\*/$folder/; print "$result\n"; The * must be escaped with the \ (\*) in the substitution. Also, note that I had to escape \ to \\ in your $string1. You ma

Fw: How to translate "\\server\alias\*****\file\" with $folder?

2002-07-14 Thread Connie Chan
> my $folder = "foldername"; > my string1 = "\\server\alias\*\file\"; should be $string1 =) > # how to make string1 = \\server\alias\foldername\file\ $string1 =~ s/\*{5}/$folder/g; the {number} means how many exactly times to match the 'stuff' ( here is * ) before. Rgds, Connie -- To

Re: Newbie about

2002-07-14 Thread Shawn
- Original Message - From: "Connie Chan" <[EMAIL PROTECTED]> To: "Paul Johnson" <[EMAIL PROTECTED]> Cc: "Mark Thumper Weisman" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Sunday, July 14, 2002 1:03 AM Subject: Re: Newbie about > > > > I'm curious about your system too. > > > > For

Re: A localtime question

2002-07-14 Thread Connie Chan
> my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst); > ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); why not combine the 2 line as : my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); > $year+=1900; > $date = $year.$mday.$mon; > >

RE: an error in a simple regexp

2002-07-14 Thread Janek Schleicher
Jess Balint wrote at Fri, 12 Jul 2002 20:03:58 +0200: > You need '?'; > > echo 123 | perl -pe 's/(\d?)(\d)/$1.$2/g' > That doesn't really work. Look at echo 123456 | perl -pe 's/(\d?)(\d)/$1.$2/g' what prints 1.23.45.6 Cheerio, Janek -- To unsubscribe, e-mail: [EMAIL PROTECTED] For ad

Re: script too slow?

2002-07-14 Thread John W. Krahn
Paul Tremblay wrote: > > I just finished my first version of a script that converts rtf to > xml and was wondering if I went about writing it the wrong way. > > My method was to read in one line at a time and split the lines > into tokens, and then to read one token at a time. I used this > line

Re: File positions and seek

2002-07-14 Thread John W. Krahn
Dave Chappell wrote: > > I am trying to use the seek function to force where my second while loop > starts within file tst.txt but I see the $. Gets reset to 0 before while > () starts. The $. is not related to the value that seek uses. To get the current position in the file that seek can use

Re: How to translate "\\server\alias\*****\file\" with $folder?

2002-07-14 Thread John W. Krahn
Chris wrote: > > I have a mask in "\\server\alias\*\file\". The asterisks will be > assigned the value of a variable. Any ideas? > > my $folder = "foldername"; > my string1 = "\\server\alias\*\file\"; > > # how to make string1 = \\server\alias\foldername\file\ my $folder = "foldername"

Re: How to translate "\\server\alias\*****\file\" with $folder?

2002-07-14 Thread chris
I am learning day by day and managed to pick up some gems from this thread.. Please forgive my posts when they are too vague and the code snippets that are too loose. Thank you for all the wonderful help -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PRO

How to use one sub in a perl package?

2002-07-14 Thread chris
I have a large perl package and need just one small standalone subroutine in it. The use statement will lead to compile errors if I do not have all the dependencies in my perl install. A work around would be to copy and paste the sub inline. Is there another way to reference a standalone sub i

Re: How to use one sub in a perl package?

2002-07-14 Thread drieux
On Sunday, July 14, 2002, at 05:31 , chris wrote: [..] > The use statement will lead to compile errors if I do not have all the > dependencies in my perl install. A work around would be to copy and > paste the sub inline. > > Is there another way to reference a standalone sub in a complex perl >

Re: How to use one sub in a perl package?

2002-07-14 Thread chris
Sounds like I am unable to reference the sub unless I make the necessary changes in the package. The use of %EXPORT_TAGS and @EXPORT_OK are considerations in the package's design. Am I understanding this correctly? On Sun, 14 Jul 2002 06:28:09 -0700, [EMAIL PROTECTED] (Drieux) wrote: >what you w

Re: How to use one sub in a perl package?

2002-07-14 Thread drieux
On Sunday, July 14, 2002, at 07:21 , chris wrote: > Sounds like I am unable to reference the sub unless I make the > necessary changes in the package. yes and no first the 'no side' - since you may need to 'get the code up and running now' = you can Work Around the problem by fully qualify

Re: How to use one sub in a perl package?

2002-07-14 Thread Peter Scott
At 10:21 AM 7/14/02 -0400, chris wrote: >Sounds like I am unable to reference the sub unless I make the >necessary changes in the package. The use of %EXPORT_TAGS and >@EXPORT_OK are considerations in the package's design. Am I >understanding this correctly? Sounds like a design problem with the

Re: How to use one sub in a perl package?

2002-07-14 Thread chris
I should have mentioned that the package does an import in main. This will make it harder if not impossible to work around. Using the sample provided > use DTK::WebAccess; This will cause the import to occur leading to compile errors. Am I reading this correctly? Thank you for your time

Re: script too slow?

2002-07-14 Thread Paul Tremblay
On Sun, Jul 14, 2002 at 04:45:19AM -0700, John W. Krahn wrote: So your split could be simplified to: > > my @tokens = split /({\\[^\s}{]+|\\[^\s\\}]+|\\[\\}]|})/, $line; > > Ah, that cuts the tokenize process in half. My entire script now takes 40 seconds to run instead of 50. Thanks! Paul

Quick ways?

2002-07-14 Thread Chris Knipe
Lo all, I was just wondering if there are any quick ways to make a directory hiracy? Say, I have the following example: if (!(-X "/usr/local/www/v-webs/$ClientCode/$WebList[1]/$WebList[2]/htdocs")) { // Directory doesn't exist. } What will be the most effective way to make this directory? I

Finding mathing files, and getting the answer as a list.

2002-07-14 Thread Lars
Finding files that matches "*.jpg" recurse. And getting the answer as a list. Well that is not how to do it $files = system("find /mnt/flash -name \"*.jpg\" "); print "$files"; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re[2]: How to use one sub in a perl package?

2002-07-14 Thread Daniel Gardner
Sunday, July 14, 2002, 5:18:14 PM, chris wrote: > I should have mentioned that the package does an import in main. This > will make it harder if not impossible to work around. > Using the sample provided >> use DTK::WebAccess; > This will cause the import to occur leading to compile err

Re: Quick ways?

2002-07-14 Thread Paul Johnson
On Sun, Jul 14, 2002 at 06:24:30PM +0200, Chris Knipe wrote: > Lo all, > > I was just wondering if there are any quick ways to make a directory hiracy? [snip] > Anyone with some code to share? ;-) It's your lucky day :-) You'll be wanting the mkpath function in the standard File::Path module

Re: Quick ways?

2002-07-14 Thread Jeff 'japhy' Pinyan
On Jul 14, Chris Knipe said: >I was just wondering if there are any quick ways to make a directory hiracy? "Hierarchy". And your solution is the standard module File::Path. use File::Path; mkpath($dir, 0, 0755); Read perldoc File::Path. -- Jeff "japhy" Pinyan [EMAIL PROTECTED]

Re: How to use one sub in a perl package?

2002-07-14 Thread drieux
On Sunday, July 14, 2002, at 09:18 , chris wrote: > I should have mentioned that the package does an import in main. what exactly do you mean by 'import in main'? this sounds way strange... could you provide us with illustrative code here. start with the simplest of code tricks #!/u

Re: Finding mathing files, and getting the answer as a list.

2002-07-14 Thread drieux
On Sunday, July 14, 2002, at 09:02 , Lars wrote: > Finding files that matches "*.jpg" recurse. And getting the answer as a > list. > Well that is not how to do it > > > $files = system("find /mnt/flash -name \"*.jpg\" "); > print "$files"; p0: that is not how you get input back from a 'chil

Re: Quick ways?

2002-07-14 Thread Chris Knipe
> On Sun, Jul 14, 2002 at 06:24:30PM +0200, Chris Knipe wrote: > > > Lo all, > > > > I was just wondering if there are any quick ways to make a directory hiracy? > > [snip] > > > Anyone with some code to share? ;-) > > It's your lucky day :-) > > You'll be wanting the mkpath function in the standa

Re: Re[2]: How to use one sub in a perl package?

2002-07-14 Thread chris
"Require" works on the top level package but the thing is so nested I will end up with errors at the next level. I just needed a quick temporary work around. In this thread, I discovered a third option that works for me. Problem definition How to make easy use of some private subs in a package w

Re: Re[2]: How to use one sub in a perl package?

2002-07-14 Thread drieux
chris, if you have the time, this problem interests me. On Sunday, July 14, 2002, at 12:59 , chris wrote: > "Require" works on the top level package but the thing is so nested I > will end up with errors at the next level. is this a set of packages that you are marking? or inherited from som

Re: Quick ways?

2002-07-14 Thread Jeff 'japhy' Pinyan
On Jul 14, Chris Knipe said: >mkpath($tmpDir, 0, oct("2750")); Uh, you can just use 02750 instead of oct("2750"). -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/ ** Look for "Regular

executing programs in windows using system

2002-07-14 Thread krishnag
I have a dual processor windows NT machine. I need to execute a .exe file from within my perl script but I need to have two copies of this .exe file running simultaneously. I can do this by starting two command prompt windows and typing the command but how can I accomplish this from within a per

RE: executing programs in windows using system

2002-07-14 Thread Beau E. Cox
Hi - A quick look at CPAN revealed Win32::Job. The examples seem to be close to what you want. I haven't tried this; not sure it will fly under NT. If not, look at the see-also section. Please let us know the result - I, for one, may need something like this in the future. Aloha

Re: Re[2]: How to use one sub in a perl package?

2002-07-14 Thread chris
I inherited these packages and trying to find nice ways to steal some code until I am able to rewrite the whole thing. You are providing valuable guidance and I will try the 'use lib' variation that you mentioned. On Sun, 14 Jul 2002 14:55:28 -0700, [EMAIL PROTECTED] (Drieux) wrote: >this is w

Re: How to use one sub in a perl package?

2002-07-14 Thread Daniel Gardner
Drieux wrote: > >> I should have mentioned that the package does an import in main. > > what exactly do you mean by 'import in main'? > > this sounds way strange... > > could you provide us with illustrative code here. I presume what the OP meant was that the module has an import() subroutine

Re: DBF File

2002-07-14 Thread Karen Liew Ying Ping
Hi, What if my DBF file is on a Windows 2k machine but the script is on another machine running Apache. How do I go about it? Is it still looking through the perldoc? Thanks -- Best Regards, Karen Liew Ying Ping Web Applications Programmer Product Delivery

(?=\d) [Was Re: an error in a simple regexp]

2002-07-14 Thread Kevin Pfeiffer
Jeff 'japhy' Pinyan writes: [...] > Here's a working regex: > > s/(\d)(?=\d)/$1./g; [converts 1234 to 1.2.3.4] > The (?=\d) looks ahead for a digit, without actually consuming it. What does that mean? Does it say, "match a digit, but always check to see that there is still at least one remai