run cmd, writing output to log file

2021-10-05 Thread reader
this error: Can't use string ("/home/reader/t/var/log/fetchmail"...) as a symbol ref while "strict refs" in use at ./pfetch line 18, <$ch> line 1. pfetch script --- --- ---=--- --- --- #!/usr/local/bin/perl use stric

cgi and absolute filenames

2009-12-20 Thread reader
This may belong somewhere else... but I'm pretty sure someone here can tell me about this. When using cgi to run scripts over html, what is the right addressing scheme when the script needs to open or alter files on the server. For example... a cgi writes a page for viewing. the cgi needs to

Re: Don't understand the errors

2009-10-19 Thread reader
John W. Krahn jwkr...@shaw.ca writes: I'm on a single user machine at home. I'm thinking I could just write to /tmp/BashHistoryDeDup.tmp with the `' flag, overwriting on each run and forget unlinking That could be a security hole. Even though you have a single user machine it is always

make perl see number as string

2009-10-11 Thread reader
What is the proper way to escape or protect an `at sign' (@) inside a perl script where you might need it for sending email. I' monkeyed around several times and got it escaped... but inbetween I always forget how I did it... and wondered if the is an accepted or common way -- To unsubscribe,

about the AT sign (@) WAS: make perl see number as string

2009-10-11 Thread reader
rea...@newsguy.com writes: What is the proper way to escape or protect an `at sign' (@) inside a perl script where you might need it for sending email. I' monkeyed around several times and got it escaped... but inbetween I always forget how I did it... and wondered if the is an accepted or

Date::Manip

2008-05-12 Thread reader
Can soneone show me how to convert unix time to something else using Date:: Manip? AFter looking at the Docs in perldoc Date::Manip I thought maybe (from the examples) something like script below would work. The first two (now commented) worked as expected but the one with unix date produces a

Re: Date::Manip

2008-05-12 Thread reader
Rob Dixon [EMAIL PROTECTED] writes: What is the right syntax? print $date = ParseDate(epoch 1210628919) . \n; Egad, and there is a big NOTE in perldoc Date::Manip about that very thing... thanks for you patience For anyone finding these posts with a search: (From perldoc Date::Manip)

How can a simple loop be speed up faster than 1 second?

2008-02-12 Thread reader
I hope this isn't some horribly difficult task... Can a perl while loop be sped up faster than 1 second intervals? I recall something about various modules that allow time to be keep in finer granularity but can things like unlink or whatever be made to run faster than one second intervals.

Re: About File::Monitor

2008-01-30 Thread reader
Jay Savage [EMAIL PROTECTED] writes: Where is all this headed? File monitoring relies on Step 4. Step 4 is where the directory pointers and block counts get updated, and the ctime and mtime get rewritten. Once your system performs Step 4, File::Monitor will see the change on its next run. How

Re: About File::Monitor

2008-01-25 Thread reader
Jay Savage [EMAIL PROTECTED] writes: Finally, Tom's points are important. How do you *know* that the files (in this case a single directory) changed *during the sleep*? Do you know that the output wasn't buffered? That the system didn't delay the writes for some reason? That you were even

Re: Monitor a directory for file creation

2008-01-24 Thread reader
Charlie Farinella [EMAIL PROTECTED] writes: On Wednesday 16 January 2008, Peter Scott wrote: On Tue, 15 Jan 2008 15:13:29 -0500, Charlie Farinella wrote: I need to monitor a directory and when a file is created, modify it. I've been playing with Linux::Inotify2 and may be able to make

[Q from Progamming perl] s/^-(?=.)//

2008-01-24 Thread reader
Just looking at ways to handle cmdline arguments. I know about getopts but I found this snippet in programming perl book and wanted to understand better what it is doing. Probably horribly obvious I guess but what is the s/// operator (s/^-(?=.)//) in the `ARG:' line doing here: Also not sure

About File::Monitor

2008-01-24 Thread reader
Can anyone provide a real example of using File::Monitor? I've been pounding away at perldoc File::Monitor, which seems to be pretty thoroughly documented but as often seems to happen to me its just not soaking in... how the scanning and reporting is supposed to happen. Somehow in the course

Re: About File::Monitor

2008-01-24 Thread reader
Tom Phoenix [EMAIL PROTECTED] writes: On Jan 24, 2008 12:34 PM, [EMAIL PROTECTED] wrote: Can anyone provide a real example of using File::Monitor? Aren't the examples in the docs and the t/ directory real enough for you? There's even a file in the examples/ directory; it looks pretty real

Re: About File::Monitor

2008-01-24 Thread reader
Jay Savage [EMAIL PROTECTED] writes: [...] Thanks for the pointers Finally, Tom's points are important. How do you *know* that the files (in this case a single directory) changed *during the sleep*? Do you know that the output wasn't buffered? That the system didn't delay the writes for

Re: Getting last key from a file

2008-01-20 Thread reader
[EMAIL PROTECTED] writes: my @tailar = qx/tail -n5 filename/; my line; Should be: my $line; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Getting last key from a file

2008-01-19 Thread reader
[EMAIL PROTECTED] writes: For example, If I have this in my file (see below) how can I get the line val220\val2, with out reading through the entire file val10\val1 val20\val2 val30\val3 val110\val1 val210\val2 val310\val3 val120\val1 val220\val2 val320\val3 If you are on a unix like

Re: Help in system function

2008-01-18 Thread reader
Tom Phoenix [EMAIL PROTECTED] writes: On Jan 18, 2008 7:00 AM, [EMAIL PROTECTED] wrote: I just want to find out whether command(mk_view $view_name ETC) is properly running or not. I think you're looking for the program's exit status. Traditionally on Unix and many similar systems, the

Re: last entry in a file

2008-01-17 Thread reader
[EMAIL PROTECTED] writes: Please keep in mind that the data in the file is only a sample and it will not alwasy be the second line from the bottome :-) I know I can read the file and keep track via a flag of where I am in the file but this seems way to over-kill. I was hoping for some nice

length in bytes not characters

2008-01-12 Thread reader
How do we get the length of a variable in bytes? I see the length function returns length in characters. unless you (From perldoc -f length): use do { use bytes; length(EXPR) } Nothing there would seem to indicate it cannot be used to get the length in characters or bytes of an array.

Re: length in bytes not characters

2008-01-12 Thread reader
Chas. Owens [EMAIL PROTECTED] writes: It is important to note that this returns the number of characters, not the number of bytes (in this case they are the same since all of the UTF-8 characters in your string take up only one byte). You need to use the bytes pragma to force length to

Re: length in bytes not characters

2008-01-12 Thread reader
Rob Dixon [EMAIL PROTECTED] writes: which outputs char19. If you're hoping for something different from this then perhaps you would let us know. Sorry if I was unclear as to what I was after. Yes that was it. 'bytes' is a pragma, and documentation on it can be retrieved in the same way as

Re: length in bytes not characters

2008-01-12 Thread reader
Chas. Owens [EMAIL PROTECTED] writes: As you can see it is normal Perl. The real magic happens inside the length and other functions. They check the value of the hints global variable ($^H) and change their behavior if the use bytes bit is set. In Perl 5.10 we have been given the ability

how to test a symlink target for directoryhood

2008-01-10 Thread reader
I'm working on a little script that will generate an html page from a directory full of symlinks to target directories. However in some cases there may be symlinks that point to regular files. How can perl tell the difference. Or rather how can I test the symlink to see if it points at a real

Re: how to test a symlink target for directoryhood

2008-01-10 Thread reader
[EMAIL PROTECTED] writes: I'm working on a little script that will generate an html page from a directory full of symlinks to target directories. However in some cases there may be symlinks that point to regular files. How can perl tell the difference. Or rather how can I test the symlink

Re: how to test a symlink target for directoryhood

2008-01-10 Thread reader
Chas. Owens [EMAIL PROTECTED] writes: On 1/10/08, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I'm working on a little script that will generate an html page from a directory full of symlinks to target directories. However in some cases there may be symlinks that point to regular files. How

Re: how to test a symlink target for directoryhood

2008-01-10 Thread reader
Chas. Owens [EMAIL PROTECTED] writes: The -X operators follow the symlink. Where is there a list of the -X operators perldoc perlop doesn't mention it. Or at least /\-X in that page doesn't find anything. if (-d $symlink -r $symlink) { print $symlink points to a readable directory\n;

Re: how to test a symlink target for directoryhood

2008-01-10 Thread reader
Chas. Owens [EMAIL PROTECTED] writes: perldoc -f -X Ack... I was trying perldoc -f X -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: how to test a symlink target for directoryhood

2008-01-10 Thread reader
John W. Krahn [EMAIL PROTECTED] writes: The -l test will tell you if a file is a symlink and readlink() will read the contents of that symlink. if ( -l $file -d readlink $file ) { print $file is a symlink that points to a directory\n; } Ahh nice... thanks -- To unsubscribe,

Getopt::Std and warnings

2007-12-14 Thread reader
I want a warning message without having to do special coding with Getopt::Std. I'd like for options passed to getops() note the plural with the (:) colon to give a warning message or even possibly die (Haven't decided that yet) if no argument accompanies them. But first: The Getopt::Std

Re: Getopt::Std and warnings

2007-12-14 Thread reader
John W.Krahn [EMAIL PROTECTED] writes: On Friday 14 December 2007 09:09, [EMAIL PROTECTED] wrote: I want a warning message without having to do special coding with Getopt::Std. Getopt is one of those itches that a lot of people have felt like scratching:

Re: Identify source of warning

2007-12-12 Thread reader
Paul Johnson [EMAIL PROTECTED] writes: [...] This would be absolutely wonderful test material for the new release! It will be interesting to see if they all still work. It certainly would. And if you find any which don't, and the reason can't be tracked back to a problem in your code (or

seek/tell usage

2007-12-11 Thread reader
Using perldoc -q tail leading to perldoc -f seek perldoc -f tell I'm not getting how to use those functions. Partly because what passes for examples in those docs doesn't use normal language, instead they use terms like WHENCE, something that's almost never used in normal language. When WHERE

Re: seek/tell usage

2007-12-11 Thread reader
Paul Lalli [EMAIL PROTECTED] writes: Read perldoc -f open for how to open a file in read/write mode. Always amazes me when someone so taken with themselves as you seem to be finds time to write a lengthy point by point rebuttal to a non-debating post but fails to SHOW where the code is

Re: seek/tell usage

2007-12-11 Thread reader
John W.Krahn [EMAIL PROTECTED] writes: man 2 lseek [ SNIP ] NOTES This document's use of whence is incorrect English, but maintained for historical reasons. OK, I see how having used WHERE in the perldoc stuff would be out of step with what its all based on. Even here

Re: seek/tell usage

2007-12-11 Thread reader
John W.Krahn [EMAIL PROTECTED] writes: use Fcntl ':seek'; seek FILE, -100, SEEK_END or die Cannot seek on './myfile' $!; Still seeing something I don't understand. Using a working version of the code I posted (included at the end) telling seek to go to 100 bytes before the byte count at eof.

Re: seek/tell usage

2007-12-11 Thread reader
John W.Krahn [EMAIL PROTECTED] writes: On Tuesday 11 December 2007 14:09, [EMAIL PROTECTED] wrote: John W.Krahn [EMAIL PROTECTED] writes: use Fcntl ':seek'; seek FILE, -100, SEEK_END or die Cannot seek on './myfile' $!; Still seeing something I don't understand. Using a working

Re: seek/tell usage

2007-12-11 Thread reader
John W.Krahn [EMAIL PROTECTED] writes: After the module name, which has to be a bareword, must follow a *list*, which cannot be barewords. My post had a typo in it .. again: use Fcntl ':seek'; it should have said and in fact is how I have been experimenting with it. I'm not sure what I did

Use of `my'

2007-12-10 Thread reader
I'm trying to convert over from yrs of not bothering to use `my var;' for variables in my scripts (All are less than 300 lines) It seems to be a big pita for the most part with no real gain. Given the brief and simple nature of my scripting needs. But that is probably due to developing a sloppy

Identify source of warning

2007-12-10 Thread reader
Can the perl interpreter be made to give more exact warning about undeclared variables? I get this warning: Use of uninitialized value in concatenation (.) \ or string at ../keywa/kywpl line 49. But there is no code at that line... its a blank line. The code immediately above has several

Re: Identify source of warning

2007-12-10 Thread reader
; } } ## If no output file was given on cmdline we use a default if (!$OutputFile){ $OutputFile = /home/reader/projects/perl/work/myfile; if(! -f $OutputFile){ usage(); print $OutputFile cannot be found .. exiting\n; exit; } } [line 49] Seems

Re: Use of `my'

2007-12-10 Thread reader
Gunnar Hjalmarsson [EMAIL PROTECTED] writes: [EMAIL PROTECTED] wrote: I'm trying to convert over from yrs of not bothering to use `my var;' for variables in my scripts http://perl.plover.com/FAQs/Namespaces.html Having been pointed to that url and another I've lost now is what prompted

Re: Identify source of warning

2007-12-10 Thread reader
[EMAIL PROTECTED] writes: Seems like these two by thier nature would not report undef. But I probably don't know what I think I know about them. Suddenly I cannot recreate the warning. Not sure what happened but most likely one of those times where I failed to save a change and then kept

Re: Identify source of warning

2007-12-10 Thread reader
was NOT the reason for the warning this thread was about. (thats probably as clear as mud too). my $OutputFile = shift || /home/reader/projects/perl/work/myfile; die $OutputFile cannot be found .. exiting\n unless -f $OutputFile; Now there is something I've been kind of put out about. Maybe

Re: How to open a file and perform an action on it.

2007-12-09 Thread reader
Mark [EMAIL PROTECTED] writes: I have looked at the perlopen tuturial, but I am still not sure how to accomplish this. I just can't believe that it is as easy as, open(INFO, datafile) || die(can't open datafile: $!); In other words how does it know what software to open the datafile

Re: How to open a file and perform an action on it.

2007-12-09 Thread reader
Mark [EMAIL PROTECTED] writes: Yes, this seems like what I want to do. I would like to open the file using the external software program, run one command on it using the external software, and then save it. If that one command is not setable from a command line it will become seriously

what role is + in open's file argument?

2007-12-05 Thread reader
I must have known the answer to this at some point because I find it in my own code various places. But I cannot recall what it is supposed to do.. Searching this group shows many instances of its use but no explanation I saw. open(FILE,+$file) [...] ; What does the `+' signify? -- To

Re: what role is + in open's file argument?

2007-12-05 Thread reader
Tom Phoenix [EMAIL PROTECTED] writes: What does the `+' signify? Have you seen the documentation for the open function? It's listed with the other functions in the perlfunc manpage, or here: http://perldoc.perl.org/functions/open.html Egad... what a dimwit... but at least you were kind

Re: Was `readdir [...]' Comments on JK's script

2007-12-04 Thread reader
John W.Krahn [EMAIL PROTECTED] writes: [...] I was reading lines with a while loop inside find() so used a `last' to break out of it. Perl gives a warning for that so I thought maybe it wasn't such a good idea... but finally resorted to sticking with the last and quieting the warnings with

Re: readdir formulated badly? gives wrong count

2007-12-03 Thread reader
Rob Dixon [EMAIL PROTECTED] writes: [EMAIL PROTECTED] wrote: Jeff Pang [EMAIL PROTECTED] writes: On Dec 3, 2007 10:12 AM, [EMAIL PROTECTED] wrote: #!/usr/local/bin/perl -w use strict; use warnings; my @ar = (); for(@ar){ print $_\n; } But running that script just

Was `readdir [...]' Comments on JK's script

2007-12-03 Thread reader
John W.Krahn [EMAIL PROTECTED] writes: (Since the topic is no longer readir I've started a new thread -hp) [...] Snipped many helpful tips that I did understand and took note of. Now for the part I didn't get but first restating the goal for context. (Usage section explains general goal)

Re: modify mirror list - CPAN

2007-12-03 Thread reader
Beginner [EMAIL PROTECTED] writes: I completely removed the .cpan directory but still the old url list was being used. I eventually found the url in the file /usr/lib/perl5/5.8.6/CPAN/Config.pm. This is on FC4. Once I removed the dead mirror, my cpan installs are much less painful. I

Re: File::Find::name output

2007-12-03 Thread reader
[EMAIL PROTECTED] (Randal L. Schwartz) writes: reader == reader [EMAIL PROTECTED] writes: reader The output I'm getting is a relative name, and that is what I've fed reader the find function. But still the docu seems to indicate it will reader return the absolute (`complete' as above) file

Re: Was `readdir [...]' Comments on JK's script

2007-12-03 Thread reader
:' `pwd`/src `pwd`/dest 20 files copied from: /home/reader/projects/perl/work/src to /home/reader/projects/perl/work/dest 20 files now in: /home/reader/projects/perl/work/dest I thought it might be because File::Find cds to the target dir then names like src dir or ./src ./dir fail

Re: Was `readdir [...]' Comments on JK's script

2007-12-03 Thread reader
John W.Krahn [EMAIL PROTECTED] writes: I thought it might be because File::Find cds to the target dir then names like src dir or ./src ./dir fail. Just guessing OK, that's my mistake, as I said I didn't test it ... oops. :-) I guess you knew this from your smilie but to confirm ... that

What is equivalent to awk's FNR (line number per crnt file)

2007-12-02 Thread reader
Seems that I recall perl having a built in like awk's FNR that keeps track of the current line number in each file. Zeros out on each new file. Like $. only goes to zero on each new file. I know how to do that with code but wondered if perl already does it thru some builtin. -- To

Re: readdir formulated badly? gives wrong count

2007-12-02 Thread reader
Harry wrote: @DirContent = grep { /^[0-9]/ } readdir(DIR); if ($DirContent[0]){ J. Krahn replied: Again, you are doing boolean tests on the contents of array elements when you should really be testing the array itself. What if $DirContent[0] contained the file name 0? if ( @DirContent

File::Find::name output

2007-12-02 Thread reader
Near as I can tell, when looking at perldoc File::Find when used as a variable $File::Find::name it supposed to be the absolute filename (In part!): perldoc File::Find (In part!): [...] $File::Find::dir is the current directory name, $_ is the current filename within that directory

Re: readdir formulated badly? gives wrong count

2007-12-02 Thread reader
Jeff Pang [EMAIL PROTECTED] writes: On Dec 3, 2007 10:12 AM, [EMAIL PROTECTED] wrote: #!/usr/local/bin/perl -w use strict; use warnings; my @ar = (); for(@ar){ print $_\n; } But running that script just does nothing but gleefully print a newline. mhh? It won't

Re: readdir formulated badly? gives wrong count

2007-12-02 Thread reader
Jeff Pang [EMAIL PROTECTED] writes: On Dec 3, 2007 12:51 PM, [EMAIL PROTECTED] wrote: Jeff Pang [EMAIL PROTECTED] writes: mhh? It won't print a newline, it even won't print anything. b/c @ar is empty, for(...) doesn't go into it, 'print' won't be happened. Yeah your right... (what was I

Re: readdir formulated badly? gives wrong count

2007-12-01 Thread reader
Thanks for taking time to respong and go clear thru the script bit by bit. kens [EMAIL PROTECTED] writes: [...] # The following lines are your friend use strict; use warnings; I've seen that before but didn't understand why. The `warnings' part is clear enough but doesn't the -w flag do

Re: readdir formulated badly? gives wrong count

2007-12-01 Thread reader
[EMAIL PROTECTED] writes: The main problem, I believe, is that you are using a stale directory handle. closedir (in main) and opendir here. Ha... and that was the problem... turns out it doesn't need to be moved. Once the typeo is corrected to closedir(DIR); it works, with no reopen.

Re: readdir formulated badly? gives wrong count

2007-12-01 Thread reader
John W.Krahn [EMAIL PROTECTED] writes: perldoc -f rewinddir Is that faster or anything than using a second opendir? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: readdir formulated badly? gives wrong count

2007-12-01 Thread reader
Tom Phoenix [EMAIL PROTECTED] writes: On 12/1/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: John W.Krahn [EMAIL PROTECTED] writes: perldoc -f rewinddir Is that faster or anything than using a second opendir? Is it faster? What did you find out when you benchmarked both ways of coding

Re: readdir formulated badly? gives wrong count

2007-12-01 Thread reader
John W.Krahn [EMAIL PROTECTED] writes: On Friday 30 November 2007 22:47, [EMAIL PROTECTED] wrote: Sorry for taking so long to reply but I was mulling it over while eating cold pizza and watching NCAAF. You don't specify the exact file names so I will assume that they match the pattern

readdir formulated badly? gives wrong count

2007-11-30 Thread reader
is a sample run (code encluded at the end) running the script the way it was intended to be used (script.pl TargetDir SourceList): ./cpNoClobber.pl test3 SourceList 16 Files copied to: /home/reader/News/agent/nntp/news.gmane.org/gmane/comp/lang/perl/test3 17 files now in: /home/reader

Divide Massive Structured data for DVD storage

2006-11-05 Thread reader
Wondering if someone here knows of or has written a perl script that is capable of figuring out how data is organized under top level directories and assigning only whole (top level) directories that will fit for writing to data DVD? Yet splitting the data for spanning DVDs? -- To unsubscribe,

cmdline program to access s.m.a.r.t. data

2006-09-22 Thread reader
Anyone know from experience of a commandline oriented program that can access S.M.A.R.T. data? In particular hard drive temperature. This would be a monitor tool for windowsxp machines. There appears to be a number of Temperature monitoring tools on the internet but what I'm looking for is one

Re: cmdline program to access s.m.a.r.t. data

2006-09-22 Thread reader
joseph [EMAIL PROTECTED] writes: Corey Hickey [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Anyone know from experience of a commandline oriented program that can access S.M.A.R.T. data? In particular hard drive temperature. This would be a monitor

Re: reading Perl syntax

2006-06-07 Thread reader
Mr. Shawn H. Corey [EMAIL PROTECTED] writes: perl -n -e /\bargs\b/ print lib/Database.pm Well I didn't learn a thing from that either: my $args = shift; $self-{file} = $args-{file}; $self-{is_reversed} = $args-{reversed} ? 1 : 0; if (defined $args-{views}) $self-{viewfile} =

Re: reading Perl syntax

2006-06-07 Thread reader
Mr. Shawn H. Corey [EMAIL PROTECTED] writes: my $args = shift Subroutine: sub new { my $class = shift; my $self = bless {}, $class; my $args = shift; $self-{file} = $args-{file}; $self-{is_reversed} = $args-{reversed} ? 1 : 0; $self-_read_file($self-{file}); $self-{filtered} = {};

reading Perl syntax

2006-06-06 Thread reader
I'm trying to debug a failing script. It is chock full of expressions like this: $self-_read_file($self-{file}) I have never used this syntax in my own scripts which are pretty basic and getting a headache trying to figure out what that line is saying. One of the @_ array being passed to the

Re: reading Perl syntax

2006-06-06 Thread reader
Mr. Shawn H. Corey [EMAIL PROTECTED] writes: use Data::Dumper; print Dumper $self; Thanks for the pointers... I haven't read it all yet but still trying to get this script to run. It is inlined at the end. Introducing your code causes a new failure and nothing is printed. [What I'm

Re: reading Perl syntax

2006-06-06 Thread reader
[EMAIL PROTECTED] writes: I'll post only one of the two cfg files being read and you'll see it has very little in it. The documentation with this script appears to be out of sync with actual script so hasn't been much help. I suspect my problem revolve around miss placing parts of the

Re: reading Perl syntax

2006-06-06 Thread reader
Anthony Ettinger [EMAIL PROTECTED] writes: The syntax {} is for a hashref, it's just an un-named hashref inside that object. my $foo = new Foo; print $foo-getFooKey(); $foo-setFooKey('new value'); print $foo-getFooKey(); Thanks for the demo... I'm in well over my head here but the name of

Re: reading Perl syntax

2006-06-06 Thread reader
Anthony Ettinger [EMAIL PROTECTED] writes: just execute it with perl -wl foo or add the shebang line: #!/usr/bin/perl -w Yes, I had done that prior to posting error output The erroring script looks like: === #!/usr/local/bin/perl -w my $foo = new Foo; print $foo-getFooKey();

Re: reading Perl syntax

2006-06-06 Thread reader
Adriano Ferreira [EMAIL PROTECTED] writes: the Perl interpreter is seeing within Package Foo; Gack, yes I see it now... I should have noticed that but it slid right by my unpracticed eye. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: reading Perl syntax

2006-06-06 Thread reader
running at the above address is very much like what I need. If you are still interested enough to look at a few more files I have posted the whole setup here with only a change in the name /cgi-bin/ http://home.jtan.com/~reader/mycgi-bin/ There you can see /mycgi-bin/gen_images which

Re: reading Perl syntax

2006-06-06 Thread reader
Mr. Shawn H. Corey [EMAIL PROTECTED] writes: [...] Yes, Dumper() calls its first variable VAR1 (it calls its second VAR2, etc.). This tells more than you know. The line: 'file' = undef, means that somewhere in your code (or the class) that 'file' was actually assigned a value (the

How to set PREFIX when perl Makefile.PL

2006-06-05 Thread reader
I knew this sometime in the past but now not finding the answer in perldoc. How does one set a PREFIX when running ` perl Makefile.PL' so that that the resulting Makefile has the proper PREFIX? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: How to set PREFIX when perl Makefile.PL

2006-06-05 Thread reader
[EMAIL PROTECTED] writes: I knew this sometime in the past but now not finding the answer in perldoc. How does one set a PREFIX when running ` perl Makefile.PL' so that that the resulting Makefile has the proper PREFIX? Never mind somehow when I tried to perl Makefile.PL

Build line editing into a script

2006-02-17 Thread reader
I want to learn how to build line editing ability into a homemade perl script I wrote. The script takes in keyboard input and formats it, also adding specific lines to the beginning and end. Making input into a blerb in a homemade flat database. Nothing complex just markers fore and aft to make

Re: How to check for a file already opened

2005-12-26 Thread reader
John W. Krahn [EMAIL PROTECTED] writes: John W. Krahn wrote: Well, let's see what each one does: Nice examples... thanks -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

How to check for a file already opened

2005-12-23 Thread reader
How can I check inside a script to see if a file has already been opened early and is still open? Does the perl interpreter keep track of that kind of stuff. It seems error prone to set a variable to TURE or something on open since you then have to remember to null it out on close. I'd like it

Re: How to check for a file already opened

2005-12-23 Thread reader
John W. Krahn [EMAIL PROTECTED] writes: [EMAIL PROTECTED] wrote: How can I check inside a script to see if a file has already been opened early and is still open? Does the perl interpreter keep track of that kind of stuff. It seems error prone to set a variable to TURE or something on

Re: Finding missing syntax element

2004-12-12 Thread reader
Lawrence Statton [EMAIL PROTECTED] writes: Well .. perhaps this is $DEITY's way of telling that having a single scope block that is 433 lines long is a bad idea. Naa, I have longer scripts that don't have this problem. It should run unless there is an actual syntax error. -- To unsubscribe,

Re: Write to file and tty from same print call

2004-12-12 Thread reader
[EMAIL PROTECTED] writes: Scott Dial [EMAIL PROTECTED] writes: Try: http://search.cpan.org/~kenshan/IO-Tee-0.64/Tee.pm === Something I've wanted a few times was a way to write to two places at once or really I mean with one print call. Something like: print FILE1 FILE2 something\n;

Re: Finding missing syntax element

2004-12-12 Thread reader
Charles K. Clarkson [EMAIL PROTECTED] writes: Harry Putnam wrote: : I've found over time that one or another of my editors will : spot a missmatched syntax element with its syntax coloring. : : Either Emacs in cperl mode or vim always helps find something : like this. : : This time I

Re: Finding missing syntax element

2004-12-12 Thread reader
Jonathan Paton [EMAIL PROTECTED] writes: The error output tells me that perl has found a difference in the number of closing and opening items. Can I get finer resolution somehow? Not sure, but you would think there was. A consistant coding style (including indenting) helps make most

Re: Write to file and tty from same print call

2004-12-12 Thread reader
Tor Hildrum [EMAIL PROTECTED] writes: I have never used this module before in my life, but are you sure $handle1 and $handle2 aren't supposed to be refs to actual File-Handles? Yeah, probably something like that but what else needs to be in there to make the example work? Running it just the

Re: Write to file and tty from same print call

2004-12-12 Thread reader
Scott Dial [EMAIL PROTECTED] writes: Try: http://search.cpan.org/~kenshan/IO-Tee-0.64/Tee.pm === Something I've wanted a few times was a way to write to two places at once or really I mean with one print call. Something like: print FILE1 FILE2 something\n; or print FILE TTY

Re: Finding missing syntax element

2004-12-12 Thread reader
Chris Devers [EMAIL PROTECTED] writes: Just because a overlong scope doesn't make Perl explode doesn't mean that it is something that most people can realistically get their head around. Thanks. I'm not sure how we are getting derailed here... The question posted is asking if there is a

Re: file renaming util in perl

2004-04-30 Thread reader
[EMAIL PROTECTED] (Peter Scott) writes: In article [EMAIL PROTECTED], [EMAIL PROTECTED] writes: Before starting to write my script designed to make filename changing easier I'd like to ask how to create an editable command line inside a perl script? [snip] Term::ReadLine Ah yes. Any idea

child processes not responding to HUP signal when parent running in BG

2002-03-21 Thread news reader
Hi, I have a script working as TCP socket server. It is forking child processes. These child processes are using system commands also. As some point of time, I need to kill all the processes running under main processes. and I am using following piece of code for that Which means to Hang up

Re: problem redirecting STDOUT to file in TCP socket server script

2002-03-18 Thread news reader
Hint: disable perl's print buffering with $|=1; before you fork(). I did this and it worked, Thanks, Appreciated very much, -Pratibha Johannes Franken [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... * news reader [EMAIL PROTECTED] [2002-03-15 21:

problem redirecting STDOUT to file in TCP socket server script

2002-03-15 Thread news reader
Hello, I have a perl script which is working as TCP socket server. In this I am redirecting STDOUT to file. with command in the begining of the script: open STDOUT, './tRL.out' or die ./tRL.out: $!; I have following four print STDOUT commands while (accept(CLIENT,SERVER)) {