Re: Output Unicode

2004-04-01 Thread WC -Sx- Jones
Octavian Rasnita wrote: It seems that something's wrong because Internet Explorer automaticly chooses UTF-8 encoding, but it doesn't display the text correctly. In fact, I don't know which is the problem because I read the text from the screen using a screen reader (I am blind) but I can read

BitVector in GET/POST Params

2004-04-01 Thread Richard Heintze
I have a bit array I need to store in GET/POST parameters and input type=hidden fields. Presently I'm storing one bit per hidden field. I would like to optimize this and use a little less space. If I know I need less than 32 elements in my boolean (bit) array, I can just use an integer in a

Passing arrays by reference

2004-04-01 Thread Richard Heintze
I'm trying to index into some function parameters that are passed as array references. Is strategy #1 (see below) identical to strategy #2? I thought so. I had a bug I that I fixed by recoding strategy #1 as strategy #2 and it fixed the problem. This leads me to believe they are not identical.

How to undine a value

2004-04-01 Thread Richard Heintze
I find I'm undefining variables my assigning an unitialized variable to defined value to make it undefined (as exemplified below). Is there a better way to do this? my $k; for($i = 0; $i $c; $i++){ if ( defined $k ){ print $x[$k]; my $t; # intentionally undefined $k = $t; #

Re: How to undine a value

2004-04-01 Thread Randy W. Sims
On 4/1/2004 11:46 PM, Richard Heintze wrote: I find I'm undefining variables my assigning an unitialized variable to defined value to make it undefined (as exemplified below). Is there a better way to do this? my $k; for($i = 0; $i $c; $i++){ if ( defined $k ){ print $x[$k]; my

Re: Passing arrays by reference

2004-04-01 Thread Randy W. Sims
On 4/1/2004 11:39 PM, Richard Heintze wrote: I'm trying to index into some function parameters that are passed as array references. Is strategy #1 (see below) identical to strategy #2? I thought so. I had a bug I that I fixed by recoding strategy #1 as strategy #2 and it fixed the problem. This

Re: How to undine a value

2004-04-01 Thread WC -Sx- Jones
Richard Heintze wrote: my $t; # intentionally undefined $k = $t; # undefine $k Just for clarity - This isn't undefining it is assignment of nothing to $k; my $nothing; print \n\$nothing\'s Value: $nothing and \$nothing\'s length . length $nothing; my $somthing = 100; $somthing =

Re: BitVector in GET/POST Params

2004-04-01 Thread WC -Sx- Jones
Richard Heintze wrote: What if I need more than 32 elements in my bit array? I suppose I could use the first hidden field for the first 32 elements of my array and the next 32 elements are stored in the next hidden field. Uggghhh... Is there an easier way? You must not read the regular beginners

Re: BitVector in GET/POST Params

2004-04-01 Thread Richard Heintze
Let me rephrase that question: Is there a way I can store large integers ( 2**32) as character strings in radix 10 or radix 16 and covert these strings to and from bitvectors from which I can insert and extract individual bits? I think bitvector is the name of the module. I did a search on CPAN

Re: BitVector in GET/POST Params

2004-04-01 Thread WC -Sx- Jones
Randy W. Sims wrote: maybe 'perldoc -f vec', 'perldoc -f pack', also http://search.cpan.org/search?query=bit I was only suggesting: man perlpacktut -Sx- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

@ in a string

2004-04-01 Thread John
I realised that the @ cannot enter in a string without escape characters. Is that equivalent to Thanks John

Re: How to determine if STDIN has piped data?

2004-04-01 Thread Robin Sheat
On Wed, Mar 31, 2004 at 11:58:58PM -0700, Bryan Harris wrote: =) I was referring to a socket. I couldn't think of any place where I might need to use one. As an example, I have a neural network system I made in Java. It accepts commands over a network socket. I then have a Perl program

Re: @ in a string

2004-04-01 Thread Randy W. Sims
John wrote: I realised that the @ cannot enter in a string without escape characters. Is that equivalent to That's not quite true. Within double quotes, anything that looks like a variable is interpreted as a variable. So, 'print @' is perfectly fine. It does not look like a variable because

directory operations

2004-04-01 Thread MuthuKumar
Hello All, I have a directory which contains several files.. like .txt .html .js files like that. I have to search a pattern in all files.. if it is available then replace it and else leave it out. I have made it for single file.. what i want is to implement for the full directory.. my

Re: How to determine if STDIN has piped data?

2004-04-01 Thread Morten Liebach
On 2004-03-30 21:35:21 -0700, Bryan Harris wrote: On Mon, 29 Mar 2004 00:38:50 -0700 Bryan Harris [EMAIL PROTECTED] wrote: Alternatively, you can use the '-t' operator: exit 0 if -t STDIN I've been waiting for this for a LONG time, thanks Smoot. No problem. It took

Re: directory operations

2004-04-01 Thread Flemming Greve Skovengaard
MuthuKumar wrote: Hello All, I have a directory which contains several files.. like .txt .html .js files like that. I have to search a pattern in all files.. if it is available then replace it and else leave it out. I have made it for single file.. what i want is to implement for the full

help in find and replacing a string in a number of files

2004-04-01 Thread prabu
Hi, i am new to perl.I am in a problem,So please help me to get a solution I want to change texts in 172 files available at a directory /pages(there are files also in a sub-directory),they all are text files. There are also some text files,which I no need to change.I want one single

Re: How Random is Random?

2004-04-01 Thread Phil Schaechter
You will note that the documentation says apparently random order. In more recent versions of Perl (IIRC starting at 5.8.1) randomness was added to hash keys for security reasons. In previous versions the order of the hash keys was determined by the hash function used which appeared random

Re: directory operations

2004-04-01 Thread Randy W. Sims
MuthuKumar wrote: Hello All, I have a directory which contains several files.. like .txt .html .js files like that. I have to search a pattern in all files.. if it is available then replace it and else leave it out. I have made it for single file.. what i want is to implement for the full

Strings with extended characters

2004-04-01 Thread Jimstone77
Is there a simple way to reject any string that has extended characters in it? In other words, only accept the 88 (I think it's 88) regular keyboard characters and numbers. I can't find a simple way to do this.

Check if another script running

2004-04-01 Thread Mike Blezien
Hello, I need to setup a cronjob to run a script every 2hrs, but if another particular script(executed via a standard web form), on the same machine, is being executed, I want the cron script wait or sleep(); till the other script is finished. Is this possible to do and how is the best way to

using strict

2004-04-01 Thread DBSMITH
People of the Perl, from my understanding strict disallows soft references, ensures that all variables are declared before usage and disallows barewords except for subroutines. what is a soft reference? what is a bareword? why is strict disallowing a compile here When I comment out strict

Need some guidance

2004-04-01 Thread Najamuddin, Junaid
Thanks in advance. Being a novice to Perl trying to write a perl script at my work in windows environment. I have couple of machines on Microsoft network load balancing (wlbs) And one url is being used to access those machines. Want to ping individual urls related to each machine on the cluster.

RE: using strict

2004-04-01 Thread Guay Jean-Sébastien
Hello Derek, When using strict, the error message should point you to the line where the error is. It's usually pretty darn good at pointing the right line. In this case, I bet it's this one: while ( defined($line = CRITICALSERVERS) ) { There is no declaration of the $line variable. Try

Check if another script running

2004-04-01 Thread Mike Blezien
Hello, I need to setup a cronjob to run a script every 2hrs, but if another particular script(executed via a standard web form), on the same machine, is being executed, I want the cron script wait or sleep(); till the other script is finished. Is this possible to do and how is the best way to

RE: Check if another script running

2004-04-01 Thread Jayakumar Rajagopal
I think your question is more related to unix than perl. Try something like this in shell script : program=$0 while ps -ef | grep $0 | grep -v grep | grep $$ do sleep 10 done or in perl $program=$0; while ( `ps -ef | grep $0 | grep -v grep | grep $$` ) { sleep 10 ; } ** I

Re: Check if another script running

2004-04-01 Thread Mike Blezien
Hi Randy, that was my original plan, but I though there maybe a better way others may use or suggest :) Appreciate the feedback, Mike Randy W. Sims wrote: On 4/1/2004 3:46 PM, Mike Blezien wrote: Hello, I need to setup a cronjob to run a script every 2hrs, but if another particular

RE: help in find and replacing a string in a number of files

2004-04-01 Thread Charles K. Clarkson
prabu [EMAIL PROTECTED] wrote: : : i am new to perl.I am in a problem,So please help me to : get a solution : I want to change texts in 172 files available at a directory : /pages(there are files also in a sub-directory),they all are : text files. : There are also some text

Re: using strict

2004-04-01 Thread Daniel Staal
--As of Thursday, April 1, 2004 5:01 PM -0500, [EMAIL PROTECTED] is alleged to have said: what is a soft reference? what is a bareword? why is strict disallowing a compile here When I comment out strict the syntax checks outs as ok!??? how do I display each element # with its corresponding

RE: Check if another script running

2004-04-01 Thread Jayakumar Rajagopal
sorry.. I missed one thing.. This is the right condition line: ps -ef | grep $0 | grep -v $$ | grep -v grep | grep $0 -Original Message- From: Jayakumar Rajagopal Sent: Thursday, April 01, 2004 5:30 PM To: [EMAIL PROTECTED]; Perl List Subject: RE: Check if another script running I

Re: Check if another script running

2004-04-01 Thread Randy W. Sims
On 4/1/2004 3:46 PM, Mike Blezien wrote: Hello, I need to setup a cronjob to run a script every 2hrs, but if another particular script(executed via a standard web form), on the same machine, is being executed, I want the cron script wait or sleep(); till the other script is finished. Is this

Re: Strings with extended characters

2004-04-01 Thread Daniel Staal
--As of Thursday, April 1, 2004 9:58 AM -0500, [EMAIL PROTECTED] is alleged to have said: Is there a simple way to reject any string that has extended characters in it? In other words, only accept the 88 (I think it's 88) regular keyboard characters and numbers. I can't find a simple way to do

RE: Strings with extended characters

2004-04-01 Thread Jayakumar Rajagopal
Jim Please send two sample strings one that contains 'reject'able stuff, and other with those 88. That would clarify us better. Jay -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, April 01, 2004 9:58 AM To: [EMAIL PROTECTED] Subject: Strings with

Hash ref's of hash's

2004-04-01 Thread mgoland
Hi all, I am trying to setup a hash who's values are referance to hash's. Data structure should look like this hash 1: setting 1 setting 2 2: setting 1 setting 2 I would think it can be accomplished with following code, but when

Re: using strict

2004-04-01 Thread Randy W. Sims
On 4/1/2004 5:01 PM, [EMAIL PROTECTED] wrote: People of the Perl, from my understanding strict disallows soft references, ensures that all variables are declared before usage and disallows barewords except for subroutines. what is a soft reference? what is a bareword? why is strict

Timezone conversion

2004-04-01 Thread Distribution Lists
can someone give me ideas of how I could convert this date and time stamp that is in GMT to Central time ? 2004-04-01-19:15:15.525+00:00 Thanks -- -- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: using strict

2004-04-01 Thread u235sentinel
Does the following turn off strict for a vars? no strict vars; Could you also turn off strict for other things besides vars, refs and subs? Say for a subroutine (for example). Just curious. I've run into situations where I've come across badly maintained code and would like to do this for

Can anyone help

2004-04-01 Thread Doug Guilding
I am trying to get perl scripts working on a win2k server - does anyone have any good ideas. My ISP say that they cannot support the use of web scripts However they have told me the path to perl and sendmail. /usr/bin/perl /usr/sbin/sendmail The problem is I can't get anything to work. I've

Check if another script running

2004-04-01 Thread Mike Blezien
Hello, I need to setup a cronjob to run a script every 2hrs, but if another particular script(executed via a standard web form), on the same machine, is being executed, I want the cron script wait or sleep(); till the other script is finished. Is this possible to do and how is the best way to

Re: using strict

2004-04-01 Thread WilliamGunther
In a message dated 4/1/2004 5:03:40 PM Eastern Standard Time, [EMAIL PROTECTED] writes: People of the Perl, from my understanding strict disallows soft references, ensures that all variables are declared before usage and disallows barewords except for subroutines. what is a soft reference?

Re: Check if another script running

2004-04-01 Thread Smoot Carl-Mitchell
On Thu, 01 Apr 2004 16:34:11 -0600 Mike Blezien [EMAIL PROTECTED] wrote: that was my original plan, but I though there maybe a better way others may use or suggest :) Appreciate the feedback, If you are running this on a Unix/Linux system check out perldoc -f flock. It enables advisory file

RE: directory operations

2004-04-01 Thread Tim Johnson
If you did want to filter based on a regular expression, you can always do it the long way: opendir(DIR,.) || die; my @file_list = readdir(DIR); foreach my $file(@file_list){ if(-f $file ($file =~ /Place Regex Here/)){ #do something... } } You get the general idea. Also,

Re: A long time helper needs help

2004-04-01 Thread William.Ampeh
Wow! Thanks a lot. I am going to try to decipher your code and hope you will not mind me asking questions later. It's a bit hard to give good suggestions if I do not understand the data. Are all the data yearly like the stuff in page6.prn? The data are bunch of report files, the format

HOWTO: File Renaming and Directory Recursion

2004-04-01 Thread Morbus Iff
Earlier this morning, a friend of mine asked me for a script that would given a list of files, replace underscores with spaces, to take this: Artist_Name-Track_Name.mp3 and rename it to this: Artist Name-Track Name.mp3 The script was mindlessly simple, and I felt it would be a good HOWTO

Re: Strings with extended characters

2004-04-01 Thread JupiterHost.Net
[EMAIL PROTECTED] wrote: Is there a simple way to reject any string that has extended characters in it? In other words, only accept the 88 (I think it's 88) regular keyboard characters and numbers. I can't find a simple way to do this. Does this help? if($string !~ m/^\w+$/) { die I hate

Re: HOWTO: File Renaming and Directory Recursion

2004-04-01 Thread Paul Johnson
On Thu, Apr 01, 2004 at 07:05:51PM -0500, Morbus Iff wrote: Earlier this morning, a friend of mine asked me for a script that would given a list of files, replace underscores with spaces, to take this: Artist_Name-Track_Name.mp3 and rename it to this: Artist Name-Track Name.mp3

Re: HOWTO: File Renaming and Directory Recursion

2004-04-01 Thread Randy W. Sims
On 4/1/2004 7:05 PM, Morbus Iff wrote: # and here is that subroutine. it's nearly exactly # the same as our previous code, only this time, we # move into the directory that contains a file to # be renamed. this is actually a quick hack because # I knew this wouldn't be production-code: a

Re: Can anyone help

2004-04-01 Thread Wiggins d'Anconia
Doug Guilding wrote: I am trying to get perl scripts working on a win2k server - does anyone have any good ideas. My ISP say that they cannot support the use of web scripts However they have told me the path to perl and sendmail. /usr/bin/perl /usr/sbin/sendmail The problem is I can't get

Re: HOWTO: File Renaming and Directory Recursion

2004-04-01 Thread Morbus Iff
while (@files) { Are you sure that's not: for (@files) { Yup, for is right. An error in my memory recall. -- Morbus Iff ( evil is my sour flavor ) Technical: http://www.oreillynet.com/pub/au/779 Culture: http://www.disobey.com/ and http://www.gamegrene.com/ icq: 2927491 / aim: akaMorbus

Re: Hash ref's of hash's

2004-04-01 Thread Wiggins d'Anconia
[EMAIL PROTECTED] wrote: Hi all, I am trying to setup a hash who's values are referance to hash's. Data structure should look like this hash 1: setting 1 setting 2 2: setting 1 setting 2 This does not look like a HoH, but a HoA. I

Re: using strict

2004-04-01 Thread Wiggins d'Anconia
[EMAIL PROTECTED] wrote: Does the following turn off strict for a vars? no strict vars; Could you also turn off strict for other things besides vars, refs and subs? Say for a subroutine (for example). Pragma are block/file scoped similar to a lexical. To answer your question below, yes you

RE: Is this possible? (file handles)

2004-04-01 Thread Venugopal P
Once you close the file, memory for the file handle will be deallocated. You can unlink file using the original file name. unlink (abc); -Original Message- From: Jeff Westman [mailto:[EMAIL PROTECTED] Sent: Thursday, April 01, 2004 2:02 AM To: perl_help Subject: Is this possible? (file

directory and file operations

2004-04-01 Thread MuthuKumar
Hi, I want to open all (.txt,.html,.js files) files in a particular directory and replace a text in all that files. What I done so far was a script to replace text in all files in the current directory. What I want was, When I run the script,it should ask for the path of a particular directory

Re: Is this possible? (file handles)

2004-04-01 Thread Smoot Carl-Mitchell
On Fri, 2 Apr 2004 10:55:07 +0530 Venugopal P [EMAIL PROTECTED] wrote: Once you close the file, memory for the file handle will be deallocated. You can unlink file using the original file name. unlink (abc); On Unix systems, you may unlink a file after opening it. The directory entry for the

Re: How to determine if STDIN has piped data?

2004-04-01 Thread Bryan Harris
Alternatively, you can use the '-t' operator: exit 0 if -t STDIN I've been waiting for this for a LONG time, thanks Smoot. No problem. It took me a while to find the correct operator as well. Please keep in mind that doing this breaks the de facto Unix standard for filters. A

RE: Is this possible? (file handles)

2004-04-01 Thread Jeff Westman
Venugopal P [EMAIL PROTECTED] wrote: Once you close the file, memory for the file handle will be deallocated. You can unlink file using the original file name. unlink (abc); This doesn't answer my question. I wanted to know if it is possible to remove a file using the FH name, not the

Re: directory and file operations

2004-04-01 Thread WC -Sx- Jones
MuthuKumar wrote: print Enter a path name: ; my $path=STDIN; chdir($path); chdir never stays in the directory... Proof: print Enter a path name: ; my $path=STDIN; chdir($path); print `pwd`; You want - perldoc -f opendir -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,

Re: Is this possible? (file handles)

2004-04-01 Thread WC -Sx- Jones
Jeff Westman wrote: Venugopal P [EMAIL PROTECTED] wrote: Once you close the file, memory for the file handle will be deallocated. You can unlink file using the original file name. unlink (abc); This doesn't answer my question. I wanted to know if it is possible to remove a file using the FH