Also check out perldoc.com for a web version.
For lots of handy tips, try "perldoc -q whatever", which searches the
FAQ's.
__
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
--- Casey West <[EMAIL PROTECTED]> wrote:
> I am quite pleased with the list so far. I have a further challenge
> for all the teachers out there:
>
> Let's create mini tutorials. The note about hashes tripped my memory
> of wanting to do this. I read about one on sort that should be here
> so
I had a similar problem on a recent upgrade -- I had put a copy of Perl
into a local directory for folks who needed it, and it was at a higher
priority than the newly installed version in my path list. I copied the
new one into the old one's spot, and everything works fine.
--- Casey West <[EMAI
--- David Gilden <[EMAIL PROTECTED]> wrote:
> Dear Casey and the list,
> Thanks for your all of your valuable help,
>
> What is $|++ for?
$| is a boolean Perl variable that determines whether the currently
selected default output stream will be unbuffered. The default it
STDOUT, so $|=1; means
And for those with embedded JavaScript to write, in which you already
have too many quotes: =o)
print< wrote:
> David Gilden writes ..
>
> >Original from the class:
> >
> >print " checked>\n";
> >
> >
> >Is this bad style?
>
> yep .. avoid backwhacks at all costs - that's my opinion
>
>
> >
Another possible solution is to use Brian Ingerson's Inline.pm and code
the reads &c. with C's lower level IO. I think a C getc() would do
it
But be warned that, while it's actually quite friendly, a raw beginner
might have some trouble with the Inline stuff, especially if they don't
know C.
}
The final result:
open VOB, "cleartool lsvob|" or die $!; # opens a pipe
while(my $entry=) {
print " This is first '$entry'" ;
}
> I am a beginner, so bear with me if there are blunders.
No problem. =o)
> Thanks in advance for any help.
> K
--- Sean O'Leary <[EMAIL PROTECTED]> wrote:
> At 09:57 AM 4/24/2001, you wrote:
> >And I almost forgot to send this to the list!
> >See? lol
>
> See how useful that Reply-To can be? : )
>
> Sean.
Even more than you think -- I mistyped the address on the CC: to the
list, and it bounced bac
sort keys %count;
Perl is a wonderfully concise language.
The above is strictly given as an example of a few performance tricks
that are worth researching. =o)
Paul
__
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
o for any digit here) 0.0, .0, and 0,
so we've covered 0.0, -0.0, .0, -.0, 0, and -0.
The join stacks them with CRLF's between, accomplishing everything but
erasing the leading space on negatives.
$result =~ s/^ //omg;# polish out the leading spaces
So, we treat $result as multiple
Agreed, and thanks for pointing that out!
--- Michael Lamertz <[EMAIL PROTECTED]> wrote:
> Paul ([EMAIL PROTECTED]) wrote:
> >
> > #!/usr/local/bin/perl -w
> >
> > use strict
> > open (FILE,$0) or die $!; # this reads itself
> > my($data,%cou
--- [EMAIL PROTECTED] wrote:
> Thank you very much for all the great help I received earlier on
> extracting numbers from text. There is only one thing I forgot
about:
> Some of the files have HTML headers and footers. I don't want any
> data inside HTML brackets. I tried:
> s/<*>//g;
> I
--- Timothy Kimball <[EMAIL PROTECTED]> wrote:
> Ah, yes, one of the most frustrating bugs in the world:
> : if ($REFln[1] = "SN") {
> This *assigns* the value "SN" to $REFln[1]. What you want to do is
> *test* it. String comparisons in Perl are done with "eq" (and numeric
> comparisons with
already exists as a directory.
To be cleaner:
unless (-e $folder) {
mkdir $folder;
} else {
die "$folder not a directory!" unless -d _;
}
Then (assuming you're reading the directory info),
opendir DIR, $folder or die $!;
Then readdir to get your data.
As always,
Hope that help
c() )
Which doesn't work on my box
> and even that is harder to use than the module. Frankly, I was kinda
> scared of the code put around getc() in the examples, and
> Anyway, I just think we should keep advice (because that is really
> what we are offer
--- [EMAIL PROTECTED] wrote:
>
>
> All,
> When I use strict function, I get an error in the following
> code.
> #!/usr/local/bin/perl
> use strict ;
> my @vob_list = `cleartool lsvob | grep "*"`;
> my $entry ;
> foreach $entry (@vob_list) {
> chomp $entry;
> my @fields = split /\s+/, $entr
--- Greg Meckes <[EMAIL PROTECTED]> wrote:
> I'm sure it's ksh (k shell - Unix). The person placing the ad
> probably dictated to the person who
> actually put the ad in and misunderstood.
Not that they could actually say "Korn shell".
lol
___
is kept exactly as in single-ticks. This text runs until it finds END
on a line by itself, though leading whitespace causes confusion.
END
Hopefully that's more than you need without getting you confused. Play
with it some. It'll work.
Drop me another note if it doesn't!
Paul
__
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
--- "Helio S. Junior" <[EMAIL PROTECTED]> wrote:
> Hello,
Hi =o)
> How do i read a simple file and look for "repeated
> words" in each line, writing out the words i have
> found and the numbers of line they were found?
>
> eg:
> File ==> Test.Dat
> sample line of text.
> this line follows anot
--- [EMAIL PROTECTED] wrote:
> I believe if you add the (g)lobal modifier and optionally(i), Paul's
> line of code may work:
>
> $line =~ /(\b\w+\b).*\1/ogi;
I didn't actually test it -- but wouldn't it still miss interlaced
words? like:
it might, it might
Would it see that "might" was
--- "Warren D. Johnson" <[EMAIL PROTECTED]> wrote:
>
> Test.pl uses variables (via use vars) from config.pl. These
> variables are defined and given values in config.pl. AFter the first
> usage of test.pl, the variables we are pulling in from config.pl no
> longer have values. So it's som
on, so you get nothing back, and
> as it is, your variables stay empty.
I didn't read it that way.
What I saw was that *any* character would qualify as a seperator, and
so all it had to return was the empty space between chars.
Paul
__
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
Could this be a buffering problem?
Maybe $|=1 at the top of the script would help?
Does it need a seek()? Hmm
--- Morgan Seppy <[EMAIL PROTECTED]> wrote:
> I've inserted text into a file before, but I can't seem to figure
> this one out. I'm trying to create a guestbook / message list.
> I
--- "Forest, Gary J" <[EMAIL PROTECTED]> wrote:
> Now I am pretty new at perl, but I have been a C programmer for over
> 15 years. If perl allows you to magically insert into a file that
> would be amazing.
>
> I tested the code below and note that this is not INSERTING text into
> the file, but
it matched
(though we only kept the first one). In a scalar context, it returns a
boolean 1 or '' that says whether it matched anything.
*READ* carefully about contexts in Perl. When using a new function, try
perldoc -f whatever
and pay close attention to what it does under different contexts.
Paul
__
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
ot;;
it goes into $somefile. You can even combine these:
open STDERR, ">$somefile" or die $!;
select STDERR;
warn "This goes to $somefile!\n" if $oops;
Paul
__
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Cc: "Chris Brown" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Tuesday, April 24, 2001 1:03 PM
> Subject: Re: [BPQ] help!! any idea whats wrong with this??
>
>
> > Paul ([EMA
--- Paul <[EMAIL PROTECTED]> wrote:
>
> --- Bill Lawry <[EMAIL PROTECTED]> wrote:
> > Pretty cool but when used on a file it breaks hyphenated words into
> > their components and counts them separately:
> >
> > 17 occurrences of 'Acct'
>
--- "Arante, Susan" <[EMAIL PROTECTED]> wrote:
> This used to be working but after my very adventurous fiasco
> (deleting perl5, installing perl6, deleting perl6, installing perl5 -
> yes i deleted not uninstalled), it's not working anymore. I'm
running
> perl5 on NT.
I'd try installing Perl5,
$count{$_}++ } $data =~ /(\w+)/sog;
> > $count{$_}++ for $data =~ /([\w-]+)/sog;
btw, "foreach" might have been more readable here, but "foreach" is
pretty much an alias to "for", which is fewer characters to type
~wink~
> - Original Message
--- "David H. Adler" <[EMAIL PROTECTED]> wrote:
> On Thu, Apr 26, 2001 at 06:43:37PM -0500, Arante, Susan wrote:
> > This used to be working but after my very adventurous fiasco
> > (deleting perl5, installing perl6, deleting perl6, installing perl5
> > - yes i deleted not uninstalled), it's not
--- Johnathan Kupferer <[EMAIL PROTECTED]> wrote:
> . . .
> Oh, and just to raise some hell: if you're new to Perl, you may also
> want to look at Python. I don't know which language I would recomend
> more...
I recommend Perl to gearheads and programmers looking for a new tool.
For rank begi
--- "Morse, Loretta" <[EMAIL PROTECTED]> wrote:
> Hello,
>
> Does anybody know how to call a subroutine that is in a .pm file from
> another .pm file.
Given A.pm
===
package A;
sub a { return "a!\n"; }
1;
===
and B.pm
===
package B;
use A;
sub b { print A::a(); }
1;
===
--- [EMAIL PROTECTED] wrote:
> I created a first simple program to append code to itself (script
> below). Is there a way to get that code interpreted in the same
> execution? That didn't happen, but when I started it a second time,
> the first appended text was interpreted, the second again not.
ar)
> Anybody familiar with this on NT?
> Thanks.
Honestly, no, but Perl is pretty platform independent.
It should be pretty much the same, though I can't promise.
Paul
__
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
=> '[EMAIL PROTECTED]', # target email
From=> '[EMAIL PROTECTED]', # sender email
Message => $msg ) or die $Mail::Sendmail::error;
print "Message sent:\n$msg\n$Mail::Sendmail::log\n";
exit;
If you run into trouble the docs can&
--- "McCormick, Rob E" <[EMAIL PROTECTED]> wrote:
> gang,
>
> # problem: open a file
> # find lines that meet a condition, put them in an output file
>
> Could you share some patterns/sample code that you use to accomplish
> this task? What pattern do you use when the output file doesn't
exis
metacharacters in the expression.
If that chokes on the $ in $value, then precede that line with
$value = '\Q' . $value . '\E';
but I don't think it will.
Paul
__
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
pretty concise line thereworks well.
Thanks. I was proud of it, lol...
> I'll need to look up $0 (perldoc perlvar: Contains the name of the
> file containing the Perl script being executed. )
Exactly. Die puts file and line if you don
my $filepath, $artist,
is that an oops? =o)
> $album,..., $title, $genre) = "$row @{ $tracks{$row} }";
Ah. It's the quotes.^ ^
That makes it a single scalar value, which gets dumped into your first
field.
> {
--- Francis Henry <[EMAIL PROTECTED]> wrote:
> Craig,
>
> I'm a newbie too, but isn't the function "chomp"?
chomp is the one Craig seems to need, but there's also a chop.
chop() alsways knock a character off; chomp only pops input record
seperators (like newline, or CRLF, depending on what the
--- Kaustav Bhattacharya <[EMAIL PROTECTED]> wrote:
> Mark,
> I only recently started coding in PERL so don't take the following as
> official.
>
> There is no CASE statement in PERL. Instead you use something called
> SWITCH.
> The O'Reilly book has an example of how to use the SWITCH statemen
fast way to write production code until you
really understand it!
Feel free to write me and ask if you're actually interested, tho,
lol
Paul
__
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
--- Kaustav Bhattacharya <[EMAIL PROTECTED]> wrote:
> I have an array populated with data, I want to dump its content to
> file but
> my following code is not writing any data out! HELP:
>
> sub wanted {
> @FILES = ();
> if ( $File::Find::name =~ /_boot\.js$/ )
> {
>
--- cherukuwada subrahmanyam <[EMAIL PROTECTED]> wrote:
> Hi,
> Iam reading flat text file of 10 lines. Each line has got data of
> maximum 10 characters.
> I want to eliminate duplicate lines and blank lines out of that file.
> i.e. something like sort -u in unix.
Got plenty of memory? =o)
--- Peter Lemus <[EMAIL PROTECTED]> wrote:
> HI Folks,
>
> I need to delete some directories, specified in
> removedir.txt, I'll like to check whether the file
> exists or not, if it doesn't I need to print file has
> been deleted. this is what I've done so far.
>
> use file::spec;
> use win32
print $line;
then you can use standard bash command-line redirection of output and
error messages as you're already wont to do. =o)
Paul
> Thanks in Anticipation,
> Regards,
>
> Thomas Adam
>
>
> Please note that the content of this message is confidential between
--- "M.W. Koskamp" <[EMAIL PROTECTED]> wrote:
> > : open FH, "lines.txt" || die $!;
> > : my %uniq;
> > : map{$uniq{$_}=1 and print $_ unless $uniq{$_} };
lol -- one better(ish):
print map { $uniq{$_} ? '' : $uniq{$_}=$_ } ; #:op
__
Do You Ya
are lots I left out.
Hell, just perldoc perl for a list!
> Thanks for any input.
>
> Olivier
>
> >-Original Message-
> >From:Paul [SMTP:[EMAIL PROTECTED]]
> >Sent:Wednesday, May 02, 2001 2:05 PM
> >To: n6tadam; [EMAIL PROTECTE
--- Ross Larner <[EMAIL PROTECTED]> wrote:
> Hello. I am attempting to print a string one character at a time.
> Right now I am using one while loop with chop to create a new string,
> the reverse of the original string, then another while loop with chop
> on the reversed string to print out th
--- Paul Cotter <[EMAIL PROTECTED]> wrote:
> There are many ways, here is one that does not involve an array
>
> my $str = 'paul cotter';
> print $1,$1 while ( $str =~ /^(.)/g );
>
> The above prints ppaauull ccooeerr (just to show it is printing
> 1 a
--- "J. Patrick Lanigan" <[EMAIL PROTECTED]> wrote:
> Now that I have CGI working with apache on my server, I am
> experimenting.
> Anyhow, I wrote the following script and was wondering how to capture
> the output of a system call. I am trying to capture the output so
that
> I can format it for
--- Casey West <[EMAIL PROTECTED]> wrote:
> On Wed, May 02, 2001 at 03:12:23PM -0500, J. Patrick Lanigan wrote:
> : Thanks to Paul and Mike for the quick response.
> :
> : Now, does anyone know how I can trim out the unwanted charecters
> from the
> : output of a man pa
--- Julian Church <[EMAIL PROTECTED]> wrote:
> . . .
> Can anyone tell me how to use Perl to obtain the modification /
> creation date of a file on an NT 4 machine?
It should be the same as anywhere else. =o)
Try -M $file (which is age in days as of when the script started), or
maybe @x=stat($
--- Timothy Kimball <[EMAIL PROTECTED]> wrote:
>
> : I have a formular with 3 text input fields ( name, fullname, and
> street )
> : and 2 submit buttons.The first submit button start a perl-script
> "work.pl"
> : and the second submit button start an another perl-script
> "checkup.pl"
> : Now,
e so many disparate pushes. You could also code
something to email the log, or even put it in the crontab (I'm assuming
this is in the crontab anyway =o)
Paul
__
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
--- "Boex,Matthew W." <[EMAIL PROTECTED]> wrote:
>
> i have a question. i need to grab files in a mailq and there are
> multiple, /var/spool/mqueue1, /var/spool/mqueue2...
What do you mean, "grab" them?
If you just want a list, use glob().
> i want to grab all the df* files in there. my que
--- Chip Cuntz <[EMAIL PROTECTED]> wrote:
> . . .
> boxes in the network to do things. Since these functions are
> essentially running on "other processors" I would like to
> spawn/fork/thread two of them and wait for both there completion.
> . . .
> What I am looking for is code snippets, an e
--- Hitesh Ray <[EMAIL PROTECTED]> wrote:
> I am required to modify an Environment variable from one value to
> another using perl script. I can access the env. variables in the
perl
> script using ENV. How can i modify so that when I exit my perl script
> -- the env. variable has new value.
Tha
--- Steve Neu <[EMAIL PROTECTED]> wrote:
> I was thinking CTRL-C would exit the program prematurely without
> printing anything but I didn't try it, so I am probably wrong.
Just at a guess, I'd say it depends on the OS.
On UNIX, I'd bet you're right.
--- Mike Lacey <[EMAIL PROTECTED]> wrote:
> my $file = $ARGV(0);
carefull there -- $ARGV(0) will probably err.
^ ^
use $ARGV[0] instead.
^ ^
__
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great price
--- justin todd <[EMAIL PROTECTED]> wrote:
> thanks Paul
> This did the trick!!
You're very welcome.
Since that was it, do you understand why?
In Perl, single-quoted strings are not interpolated (that is, are not
parsed for special characters or variables). Thus, if
$foo
--- Clinton <[EMAIL PROTECTED]> wrote:
> WOW, thanks a heap. This is the best list ever.
lol -- high praise!
> The final code that seems to work is:
>
> use strict;
> my $file = "test.txt";
> my $stuff="e:/$file";
> open STUFF, $stuff or die "Cannot open $stuff for read :$!";
> my $file_conten
--- Tony Cook <[EMAIL PROTECTED]> wrote:
> On Mon, 7 May 2001, Johan Groth wrote:
> > I want to strip a variable of all characters including a token,
> > aaa_bbb_ccc_ddd would become bbb_ccc_ddd.
> > . . .
> > I've tried:
> > $tmp = "aaa_bbb_ccc_ddd"
> > $tmp =~ /^\w+_/
> > $tmp = $';
> > but th
--- Craig Moynes/Markham/IBM <[EMAIL PROTECTED]> wrote:
> . . .
> I have a string like this:
> $string1 = "[%a %H:%M:%S %c] - - etc.etc.etc";
>
> I need to parse out all the substrings that are similar to "%x"
> (where x is any letter)
try
my @chars = $string1 =~ /%(.)/g; #:o)
You can proba
--- Craig Moynes/Markham/IBM <[EMAIL PROTECTED]> wrote:
> . . .
> I have a string like this:
> $string1 = "[%a %H:%M:%S %c] - - etc.etc.etc";
>
> I need to parse out all the substrings that are similar to "%x"
> (where x is any letter)
If you sepcifically need an alpha character, you might try
Okay, my turn to ask a newbie question. =o)
Our HPUX box didn't have GDBM installed, so I just downloaded and
compiled it from GNU, but I still don't have GDBM_File.pm, and I don't
see any way to get it aside from either dowgrading to 5.005 or
cross-grading to 5.7. I'd rather not use the experime
--- Craig Moynes/Markham/IBM <[EMAIL PROTECTED]> wrote:
> [snip . . . ]
> The number of mini-regexp differs depending on the date format line
> the user enters. So i find out how make keys there are (thus the
> number of mini-regexps) and try to construct a string that will print
> out whatever
--- Paul Cotter <[EMAIL PROTECTED]> wrote:
> From: "Jeff Pinyan" <[EMAIL PROTECTED]>
> > On May 10, Paul Cotter said:
> > >What combination of sprintf/pack/upack/asc/hex/xyz.pm etc will
> > > allow me to convert a string in to a string hex equi
so that only newlines
followed by letters count. If that's not exactly the effect you want,
you could easily edit the pattern. =o)
This is assuming the structure of the file is pretty uniformly
consistent with the example you gave.
Good luck,
Paul
=
print "Just another Perl Hacker\n&quo
--- Peter Lemus <[EMAIL PROTECTED]> wrote:
> Hi, I need to check to see if a file exists in a
> directory, if it does then delete it, else ..
>
> is this the correct syntax?
>
> if (-e $file and -f _) {
> system ("del $file") ? print "File $file deleted\n"
> : warn "File $file WAS removed:
--- Nic LAWRENCE <[EMAIL PROTECTED]> wrote:
> Can anybody suggest the most efficient method to do the following...
>
> I have an array of email aliases like the following:
> [EMAIL PROTECTED]: sys
> [EMAIL PROTECTED]: coookiecom
> [EMAIL PROTECTED]:
--- Carl Rogers <[EMAIL PROTECTED]> wrote:
> Not having Perl up and running, would this work with the
> parenthesis??
> $temp = ~ m/PT[\(]*(\w+)[\)]*/;
> $value = $1;
> I'm sure there is a one-line answer, but I'm too new to know.
>
> At 05:13 PM 5/10/2001 -0400, Gross, Stephan wrote:
> >I w
enough, though
usually you want a short phrase or sentence.
And finally, please don't think this tirade was because I thought
someone needed a scolding! lol! I just started an OT comment, and then
remembered to mark it and drifted fro
--- Jeff Pinyan <[EMAIL PROTECTED]> wrote:
> >> . . . Orcish maneuver, to increase speed.
> >> { my %cache;
> >> @new = sort {
> >> ($cache{$a}) = $a =~ /\@([^:]+)/ if not exists $cache{$a};
> >> ($cache{$b}) = $b =~ /\@([^:]+)/ if not exists $cache{$b};
> >> $cache{$a} cmp
--- [EMAIL PROTECTED] wrote:
> All, I am looking for a way to send the output of a logfile using
> Mail::Sendmail. Is that possible? If so can some body give me a high
> level syntax.
my $content;
open LOG, $log or die $!;
{ local $/ = undef;
$content = ;
}
close LOG;
$mail{Message} = "Pre-
--- Paul <[EMAIL PROTECTED]> wrote:
> --- [EMAIL PROTECTED] wrote:
> > All, I am looking for a way to send the output of a logfile using
> > Mail::Sendmail. Is that possible? If so can some body give me a
> > high level syntax.
If the previous method isn'
--- "Gross, Stephan" <[EMAIL PROTECTED]> wrote:
> I wasn't clear last time. I wrote:
> >I want to match the following:
> >1) the letters "PT"
> >2) a space or nothing
> >3) a word that may or may not be in parentheses or even not exist
> >and return item #3 (which may be null)
> >Example:
> >PT
> for (keys %{ $dirs{$entry} }) {
> gonkulate($entry,$_) if $dirs{$entry}{$_}[0] eq '0';
This would become:
for (keys %entry) {
gonkulate($entry,$_) if $entry{$_}[0] eq '0';
> }
> rend_thee($entry) if exists($meta{$entry}{nuptdate})
--- David Falck <[EMAIL PROTECTED]> wrote:
> Problem:
> I have a fixed length customer record. When I create the record, I
> add \n. But my testing tells me that when I read (seek) the record
> below, I have to add 2 for Windows or 1 for UNIX.
>
> # Customer file data -
> $cst_template =
> "A9A
--- justin todd <[EMAIL PROTECTED]> wrote:
> I am looking for a way to print just a certain in a browser.
> Is this possible?
Seems likely, but I think we'll need a little more info. =o)
__
Do You Yahoo!?
Yahoo! Auctions - buy the things you want
--- Collin Rogowski <[EMAIL PROTECTED]> wrote:
> You get the size of an array by using it in a scalar context.
> $size = @a;
This is entirely correct.
But for those of you who prefer a more explicit syntax, you can put any
expression into scalar context with the "scalar" keyword. For my own
tast
--- Peter Cornelius <[EMAIL PROTECTED]> wrote:
> A cool control structure in perl is the for or foreac loop. With it
> you don't need to know the size of the array you can just
>for my $thing (@A) {
> #do stuff with $thing
>}
This is very efficient; just keep in mind that $thing i
--- Edson Manners <[EMAIL PROTECTED]> wrote:
> I am having trouble finding a list of formatting characters that deal
> with the backslash and forward slash characters in Perl.
> For example... What does
>if ($line =~ /^$i\./)
> mean I understand everything except the characters ^$i\./
> W
--- Gary Luther <[EMAIL PROTECTED]> wrote:
> I guess what I am asking is how in the Perl do you set the read
> pointer??
Observe perldoc perlfunc.
More specifically:
perldoc -f tell
perldoc -f seek
Just store the address of the pointer after you hit a "node",
then go back to the previous
--- Peter Scott <[EMAIL PROTECTED]> wrote:
> > A rather clever way to emulate locking is to use mkdir() and
> > rmdir().
> > Although it requires you to create a lock file, it's atomic and
> > safe.
> >
> > sub lock {
> > 1 until mkdir "$_[0].lck", 0777;
> > $locked{$_[0]}++;
> > }
On
--- chris brown <[EMAIL PROTECTED]> wrote:
> --- David Falck <[EMAIL PROTECTED]> wrote:
> >--snip--
>
> I am pretty new at Perl so don't know the syntax to do
> this, but could you sidestep the issue and count the
> number of bytes in \n, then subtract as appropriate?
\n is just one byte, but y
--- David Falck <[EMAIL PROTECTED]> wrote:
> I still haven't figured that one out. My record is 303 and length of
> record returns 304. Why... I just don't know.
Got a null on it?
=
print "Just another Perl Hacker\n"; # edited for readability =o)
=
--- "Porter, Chris" <[EMAIL PROTECTED]> wrote:
> Any ideas???
> > me. I want to create a script that deletes uppercase words from a
> > directory using the unlink command. Probably a very simple thing
chdir $dir or die $!;
opendir DIR, "." or die $!;
for my $file (grep { -f $_ } read
}
}
try looking at the perldocs for
perlref
perlreftut
perlobj
perlboot
perltoot
perltootc
Paul
(Original code left below for reader's convenience)
> my @lines=( # simulate read cobol file
>
> " file-control.\r\n",
> "
--- Peter <[EMAIL PROTECTED]> wrote:
> when i append the &refresh=x, i get a software error:
> Execution of cgi aborted due to compilation errors
so what are the other errors?
try posting the whole code if necessary, and the whole output to the
screen when you try to run it. =o)
=
print
--- Peter Lemus <[EMAIL PROTECTED]> wrote:
> Hi, folks,
>
> I need to get every possible error on this script
> including errors from system commands.
lol -- looks more like a batch file. ;o]
Seriously, you might consider putting all this in one SOMEFILE.BAT and
running that as an open3(), t
--- Jos I Boumans <[EMAIL PROTECTED]> wrote:
> well, you can always redirect it to a file like this;
>perl foo.pl > /null
> even on a wintendo...
Doesn't get STDERR, just STDOUT.
Then again, I have real trouble in Win32 determining what's going to
STDERR anyway
=
print "Just anoth
--- Jos I Boumans <[EMAIL PROTECTED]> wrote:
> well, you can always redirect it to a file like this;
> perl foo.pl > /null
> even on a wintendo...
Nope, doesn't work. Tested this way:
C:\users\default>perl>x
print STDOUT "stdout\n";
print STDERR "stderr\n";
^D
stderr
C:\users\default>t
RE: Collecting error output from child processes on Win32
==
I think this will work:
open STDERR,">$logfile" or die $!;
That should close STDERR and reopen it to the specified output, which
child processes will then inherit.
Another tr
--- Adam Theo <[EMAIL PROTECTED]> wrote:
> hello, all. I have been a user of a particular web-board discussion
> forum script for a while now (Darryl C Burgdorf's WebBBS
> http://www.awsd.com/scripts/webbbs), and am wanting to develop a perl
> script that will pass information directly to it, for
--- Peter Cornelius <[EMAIL PROTECTED]> wrote:
> The doesn't read into $_. You can add a 'print $_;' in there
> to verify it. I think you're getting confused by the
>while(){...}
> structure. This puts the result of the readline into $_ for you if
> the is the only thing in the '()'. Ot
--- Liger-dc <[EMAIL PROTECTED]> wrote:
> What does the following formatting do?
>$line =~ /^; .ot (\d+)/)
^
Gives you a compile error.
Unmatched parens are bad. =o)
Otherwise, this line would attempt to match the contents of $line,
returning true if $line contai
--- Paul Johnson <[EMAIL PROTECTED]> wrote:
> On Wed, May 16, 2001 at 10:05:14AM -0700, Matt Noel wrote:
> > I have a simple two-dimensional array, call it @Weights. I think
> > of the first index as being the Row index and the second being the
> > Column index. N
--- "Porter, Chris" <[EMAIL PROTECTED]> wrote:
> Silly question --- where do i exactly insert all of my information
> that points to where my changes need to be made. Sorry if this is a
> stupid question. Thank you.
If you don't know, it would be sillier not to ask. =o)
chdir "/the/directo
1 - 100 of 1648 matches
Mail list logo