Stefan Oswald wrote:
>
> I sometimes hear there is a compiler avalaible which produces win32exes out
> of perl scripts ...
> Has anybody further information ??
>
I think that the perl script is converted to a bat file , and is loaded
as such .
Anybody cares to correct me on this .
Regards Pete
help on my next steps would be very much appreciated!
Pete
Use substr. This will leave you with 5 characters:
$text='abcdefghijklmnopqrstuvwxyz';
$text=substr $text, 0, 5;
print "$text\n";
Output:
abcde
Bruno Veldeman wrote:
> Hi,
>
> I have been looking for a function to truncate a string at a given lenght, but am
>lost.
>
> None of the functions see
where
student_id=$student_id";
$query=$dbh->prepare($prep_query);
$query->execute;
($school,$path)=$query->fetchrow_array();
Any easier ways to compact this one would also be terrific.
Thanks in advance. Perl rocks.
Pete
27;$username'";
($daterequested,$datecreated)=$dbh->selectrow_array($prep_query);
or you could even go the extreme and put the query in quotes in the parentheses
after selectrow_array.
Once again, thanks for your input!
Pete
his for me:
color=red&hidden=hello
The $ENV{'QUERY_STRING'} is all of the submitted pieces of information all at
once, in pairs, with an & separating the pairs. To pull out individual pairs
with the CGI module, you can do:
$color=param('color');
$hidden=param('hidden');
I hope this helps.
Pete
replied. Well, there's one more
explaination, for whatever it's worth. By the way, I really like those other
explainations, it's informative to me as well, even though I've got a
correct solution. It just goes to show that while there is always more than
one way to DO it in
using opendir and closedir). Zoiks. Guess that's why I'm
reading this list!
Pete
Shawn wrote:
> opendir DIR, $directory or die "can't open $directory: $!\n";
> @files = grep /jpg$/i, readdir DIR;
>
> On 06/07, John Storms rearranged the electrons to read:
[ snip ]
n
ahead of time, and my book backs that up, but I'm losing you after you set
the $attr. Inquiring mind(s) want to understand! Thanks.
Pete
Jeff 'japhy' Pinyan wrote:
> On Jun 7, Adrian Pang said:
>
> >I'm trying to write a regex expression so it will extra
ope that
if I'm missing the boat you'll respond. And thank you for mentioning that you've
written a book (Perl Debugged, correct?); you've piqued my curiousity. This list
is great; I'm learning a lot. Thanks!
Pete
Here's my version. It's pretty straightforward, but maybe Ondrej's solution is
far better for some reason?
#!/usr/bin/perl -w
use strict;
my $inputfile; my $outputfile;
$inputfile='myinfile.txt';
$outputfile='myoutfile.txt';
open (INFILE, "$inputfile") || die "Can't open input file\n";
open (OU
Sorry to reply to my own post, but I just looked carefully at Ondrej's solution,
and the nice thing about it is that it doesn't matter what order the columns are
in, it will always sort on the header. So his program is a lot more generic than
mine. Nice!
Pete
Pete Emerson wrote:
&
handled getting the file information (using @ls=`ls -A $dir`). Thank
you.
Pete
#!/usr/bin/perl -w
use strict;
use File::stat;
my $startingdir="/tmp"; # could use $ARGV[0] here to make it more
generic
my $cutoff=5;# could also pass in the cutoff from
the
n't cut it for recursion.
Is there an easy way to parse those out or ignore them?
Can you give an example of how to do the globbing which also ignores . and ..
?
Pete
Jeff 'japhy' Pinyan wrote:
> You could go over the entries from readdir() one at a time:
>
> opendir DIR, $dir or die "can't read $dir: $!";
>
> while (defined(my $file = readdir DIR)) {
> next if $file eq '.' or $file eq '..';
> my $full = "$dir/$file";
> # ...
> }
>
> closed
> open CSV,"
Perl
script.
Hope this helps.
{Pete
---
($_='Yw_xUabcdtefgdijktljkotiersjkUzxT
yvlkbfdtcierstajogvPruntRshackRJelov')
=~y/RTUv;wxYz$/ ~'\/;$=();/;eval;print
>Are there modules that will allow me to read from and write to tape on a
record or block basis?
(a) Where have you looked? Have you tried http://www.cpan.org and
http://www.google.com ?
(b) You can always write a Perl module to wrap around a driver in C, which
I'm sure will exist
rt 80.
Javascript is nice for telling users if they've got it wrong. If you're
going to trust it, you're on crack.
Hope This Helps
{Pete
---
($_='Yw_xUabcdtefgdijktljkotiersjkUzxT
yvlkbfdtcierstajogvPruntRsh
proxy server, and print out all correspondence. Then post
it on the web for others to read.
Hope This Helps
{Pete
---
($_='Yw_xUabcdtefgdijktljkotiersjkUzxT
yvlkbfdtcierstajogvPruntRshackRJelov')
=~y/RTUv;wxYz$/ ~'\/;$=();/;
Nope, simple filehandle, nothing special for webservers.
Happy To Help
{Pete
---
($_='Yw_xUabcdtefgdijktljkotiersjkUzxT
yvlkbfdtcierstajogvPruntRshackRJelov')
=~y/RTUv;wxYz$/ ~'\/;$=();/;eval;print
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
No. It's *VERY* illegal.
"Brett W. McCoy" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> On Sat, 14 Jul 2001, Mark Winchester wrote:
>
> > Just found this posted on another site. Many free Perl
> > books.
>
> Is it legal to put those on the web like that? It
reate yoru window look and feel.
---
All it takes is a simple look. :)
Yup, the Tcl/TK tool can be made to do the trick:
http://www.keck.ucsf.edu/~kvale/specperl
Have phun
Pete
---
($_='Yw_xUabcdtefgdijktljkot
"Craig Paterson" <[EMAIL PROTECTED]> wrote in message
021601c13a9a$bae3f240$0925020a@avalon">news:021601c13a9a$bae3f240$0925020a@avalon...
> is this possible? or is there another library
> i should use? I looked at the HTTP library but
> can't see how you would do it and save the file.
LWP is yo
Bruno,
I used CGI and LWP::Simple to get ESPN's AL East baseball standings table
and then rewrite that table into a format that I wanted. You can see it at
http://jasper.cs.yale.edu if you're curious (insert shameless plug for the Red
Sox here). But that sort of thing might help you to grab th
Some other notes...
You don't have to use printf - you can use print. And you don't need the
brackets, or the inverted commas around $path:
if ($path =~ m/^\$/) {
print "Path is env var\n";
} else {
print "Working on phys.dir\n";
}
> > if ( "$path" =~ /^$/ ) {
> >printf("p
at sim.pl line 3.
> BEGIN failed--compilation aborted at sim.pl line 3.
That's the standard error message to say that you don't have the module
installed.
It surprises me somewhat too that you want to use Win32::Process on a
non-Windows machine - I would imagine it's kinda OS dep
I don't know the answer to your question, but...
You can download the PPM files seperately from activestate:
http://www.activestate.com/PPMPackages/zips/5xx-builds-only/
You can then use PPM to install them, but I think that part's covered in the
readmes.
"Reg Smith" <[EMAIL PROTECTED]> wrote i
other text?
Sure! This is what Perl excels at. You should go through the file line by
line, and write a regular expression to identify mail ids. You can store
these and then write them to a file, or write them to a file
ould suggest is writing a
script that you 'require' that will return a username and password. You
could do all kinds of magic to hide and encrypt the user/pass that this
script returns, and so on.
+Pete
--
---
($_='Yw_
How do I insert $scalar into position $x of @array, where $x is smaller than
$#array?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
> @hosts = ( list of hashes like below ... );
> %hosts = ( name => "hostname",
> ipaddr => "www.xxx.yyy.zzz",
> location => "location"
>);
>
> How can produce a sorted list of the hashes based on the hostname and then
> access each hash to print the details.
>
@hosts = sort { %{$a}
I wonder why the use of sprintf? I would have done it this way:
foreach (@list) { $_=":$_"; }
Is there something that the sprintf does that I'm missing, or is this
just another way to skin the same cat? Perhaps in other circumstances
sprintf is superior?
Just curious,
"string" if\and\only\if they're
followed by a ' or ".
Hope that helps.
>From one beginner to another (i.e. someone else is about to point out a
better way),
Pete
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
e faster, as far as I
remember
o Try profiling your Perl code to see where it slows down: Brian d Foy
covers this in: http://www.ddj.com/columns/perl/2001/0104pl001/0104pl001.htm
Uh. Before I go any futher I've found a webpage that offers the rest of my
advice and some more:
http://use.
.com/pub/a/2001/04/10/engine.html
is an article I wrote describing one situation where it's *faster* to use
text files in a search engine... The best thing to do would be to write a
simple test case for each and to test them, using perhaps the profiler
discussed earlier.
Happy to hel
od ne $newmethod)) { ... }
This is covered in perlop, which you can read by:
o Going to http://www.perldoc.com and searching for perlop
o Typing 'perldoc perlop' at a computer with Perl installed
o Opening $perl_dir/html/lib/pod/perlop.html on a computer with Activestate
Perl installed
isn't perl code and/or doesn't terminate with a true value,
then you're doing something wrong. If you're getting an error about not
being able to find the module, may I suggest:
$file = "/absolute/path/to/files/$FORM{'id'}/options.txt";
eval "
> What I don't yet understand is the other direction: How do I make
> individual configuration variables, taken from database.cfg, available in
> the modules or db.cgi? I guess that would be a job for "require", but am
> not sure.
You have a number of options. My prefered one is to do this:
(opt
isbnInquiry.asp?mscssid=HMUFLHMEL5
NT8N6GL9PCMT2TD1FGAG12&isbn=0596000324
Or at any good bookstore.
+Pete
--
[EMAIL PROTECTED]
;;($_='Yw_xUabcdtefgdijktljkotiersjkUzxT
yvlkbfdtcierstajogvPruntRshackRJelov')=~
y&/RTUv;wxYz$&/ ~'/;$=();$&&&eval&&a
tory
Or is it some other message all together? We have a saying somewhere I idle:
Look buddy, doesn't work is a strong statement. Does it sit on the couch all
day? Is it making faces at you? Does it want more money? Please be specific!
So, please be specific! :
e CPAN.pm documentation interesting:
http://www.perldoc.com/perl5.6.1/lib/CPAN.html
Hope this helps
+Pete
--
[EMAIL PROTECTED]
;;($_='Yw_xUabcdtefgdijktljkotiersjkUzxT
yvlkbfdtcierstajogvPruntRshackRJelov')=~
y&/RTUv;wxYz$&/ ~'/;$=();$&&&eval&&print
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
> `"$batch" "$name"`;
> #! doesn't work - and that's the clue of my problems
>
> and also system doesn't want to work with $batch and $name as it's
parameter
`` interpolates.
You probably want:
`"$batch $name"`;
or
open(NAMES, "names.txt")||die "$!";
($result = join '', )=~s/\s+/ /g;
+Pete
--
[EMAIL PROTECTED]
;;($_='Yw_xUabcdtefgdijktljkotiersjkUzxT
yvlkbfdtcierstajogvPruntRshackRJelov')=~
y&/RTUv;wxYz$&/ ~'/;$=();$&&&eval&&print
Find out your Perl PID, find out the user who's running it, and kill their
session using `kill`?
+Pete
"Bob Showalter" <[EMAIL PROTECTED]> wrote in message
2E4528861499D41199D200A0C9B15BC031B508@FRISTX">news:2E4528861499D41199D200A0C9B15BC031B508@FRISTX
look in to the alarm() function
perldoc -f alarm
+Pete
--
[EMAIL PROTECTED]
;;($_='Yw_xUabcdtefgdijktljkotiersjkUzxT
yvlkbfdtcierstajogvPruntRshackRJelov')=~
y&/RTUv;wxYz$&/ ~'/;$=();$&&&eval&&print
<[EMAIL PROTECTED]> wrote in message
generous person has more comments to make. I understand
that this might not be the right place for a big "RFC on my program", so
feel
free to stop reading at this point .Thanks very much in advance.
Pete
#!/usr/bin/perl -w
use strict;
use File::
If I understand your question correctly, this will work:
#!/usr/bin/perl -w
use strict;
my ($a, $b, $c, $one, $two, $three);
$a=1; $b=2; $c=3;
($one, $two, $three)=Change($a, $b, $c);
print "$one $two $three\n";
sub Change {
my ($x, $y, $z)=@_;
$x++;
$y=0;
$z=10;
return ($x, $y, $z
dress\n";
$full_address=~/^"(.+)" <(.+)>$/;
$user=$1;
$email=$2;
print "$user\'s email is $email\n";
If the format is ALWAYS going to be this way, this works, otherwise you
might
want to make the regex conditional and do some error checking. Hope that
helps.
;);
Now C calling a Perl program:
perlhelloworld.pl
#!/usr/bin/perl
print "Hello, World, in Perl!\n";
cprinter.c gcc -o cprinter cprinter.c
#include
int main() {
system("./perlhelloworld.pl");
}
$ ./perlprinter.pl
Hello, World, in C!
$ ./cprinter
H
Well, suppose my C program does this:
$ ./cprogram
First Name: Pete
Last Name: Emerson
I could use a Perl program like this to analyse the output:
The key is that the backticks execute any executable file and store the
output.
#!/usr/bin/perl -w
use strict;
my $cstuff=`./cprogram`;
my
When I send mail to a certain address, the mail gets piped to my perl
script.
I'm then using Mail::Internet to extract info, including the From
header.
For me, the header looks like this
Pete Emerson <[EMAIL PROTECTED]>
1. I assume that they're all going to look different. Is tha
Since we're on the topic of sorts, what are the arguments for
the implemented quicksort vs. a radix sort?
Pete
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
that the data is unsorted or
random,
it might be to your advantage to run the radix algorithm instead.
Thoughts? Anyone done some testing on actual data? What's that timing module
again?
Pete
--
Mynd you, møøse bites Kan be pretty nasti...
--
To unsubscribe, e-mail: [EMAIL PRO
hat happens.
Okay, maybe it's wandering a little far from Perl Beginners, but it sure is
interesting!
Pete
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Okay, so I'm trying to implement your radix sort, and something's going wrong.
When I turn on warnings (I'm using Perl v5.6.0) I get:
Multidimensional syntax $table[substr $_, $i, 1] not supported at ./sort3.pl line 31.
and when I turn on strict:
Can't use an undefined value as an ARRAY reference
ML source. Argh!
Pete
--
Mynd you, møøse bites Kan be pretty nasti...
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Here is an example of what I'm doing to detect whether I've got a scalar value in my
hash
or a hash of hashes:
#!/usr/bin/perl -w
use strict;
my %hash;
$hash{name}='Pete';
$hash{color}{favorite}='Blue';
$hash{color}{car}='Silver';
$hash{color}{hous
Is there a faster way to calculate the hex md5 of a file?
sub md5 {
my $file=shift;
open (FILE, $file) or die "Can't open '$file': $!";
binmode(FILE);
my $hash=Digest::MD5->new->addfile(*FILE)->hexdigest;
close FILE;
return $hash;
}
--
To unsubscribe, e-mail: [EMAIL PRO
lace "one two" with "one_two" and
"one two three" with "one_two_three", thinking that then I could split on spaces
and then strip out the _, but I didn't have any luck with that, either. Any pointers
would be greatly appreciated.
Pete
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
ot; foreach (@ar);
This works, too, but I don't understand what the ?: is for;
my Perl book says it doesn't do backreferences; what does that mean?
Oh, fun with regexes. :)
Pete
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Jeff 'japhy' Pinyan wrote:
> For the task of parsing quoted strings, my book suggests the inchworm
> method:
>
> push @terms, $1 while
> /\G\s*"([^"]*)"/g or
> /\G\s*(\S+)/g;
Hmmm...mine seems to go into an infinite loop:
#!/usr/bin/perl -w
use strict;
my @terms;
$_='"one two three"
nybody have tips as to how to get this to work via SSL?
I'm guessing I need to use Mail::IMAPClient's Socket() function,
but I think maybe I need a different module (IO-Socket-SSL???) to
help me out. Any pointers would be appreciated. Maybe there's a module
to do IMAP via SSL?
ndle.
which can be downloaded and installed from www.cpan.org. Good luck!
Pete Emerson
--
Mynd you, møøse bites Kan be pretty nasti...
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Here's my stab at it:
#!/usr/bin/perl -w
use strict;
my %info;
open INFILE, "$ARGV[0]" or die "Can't open file: $!\n"; # Open file specified on
command line
while () {
chomp;
my ($date, @data)=split; # Capture the date, then the rest
$date=~s/_\d{4}$//; # Re
Hi All,
I have file:
PHI: 15
CA: 32
NY: 14
PHI: 35
NY: 11
CA: 22
NY: 23
CA: 36
I need to put it into hash. Key State, Value Number (Average Value!!!)
So in output I should have:
PHI:25
CA:30
NY:16
-
Do you Yahoo!?
Yahoo! M
8| |23 16|
|___|___| |___|___| |___|___|
|M|M|M|M|M|M|M|M| |E|E|M|M|M|M|M|M| |S|E|E|E|E|E|E|E|
Least Sig. Byte Most Sig. Byte
Sign 1 bit
Exp 9 bits
Mantissa 14 bits
00 60 c0 = -3.5
00 00 40 = 2.0
00 40 40 = 3.0
00 60 40
)/;
print "$1 $2 $3 $4 $5 $6 $7 $8\n";
$ieeedouble =~ /(.)(.{11})(.{52})/;
print "IEEEDBL SIGN:$1 EXP:$2 MANT:$3\n";
print "5 " . "-" x 50 . "\n";
# looks ok to me
$one = pack "B64", $ieeedouble;
# print $one; # od -t x1 40 04 00 00 00 00 00
ader without the cookie
depending on the behaviour you want.
Cheers,
Pete
On 04/05/11 14:23, Agnello George wrote:
Hi
In my script i am using template toolkit. I am trying to set the
cookie in my browser but all that it does is it prints the following
output on my broswer :
Set-C
. You need to send the header in all cases. Try changing your if
block to:
if ( $evalue == 3 ) {
my $cookie = $cgi->cookie(CGISESSID => $session->id);
print $cgi->header( -cookie=>$cookie );
deploy_page();
}
else {
print $cgi->header;
}
Pete
The $cgi-&g
way?
The Modern Perl suggestion when dealing with dates and times is to use
DateTime. It is well tested and should handle edge cases you may not
have considered. After all, what do you do when you want to round up
from 2011-12-24 23:58:00?
You can use Math::Round to do the rounding for you.
Ch
I imagine there are going to be many recommendations - and there are
always new, "better" modules coming out for this sort of thing. However,
I'll kick things off to say I've used MIME::Lite [1] for a long time and
it has always done everything I've needed.
password in a configuration
file (and use something like Config::General to load it) which is only
readable by a secured user. You can then setuid [1] the script to
execute as that user - however, take note of any security issues this
might infer.
Cheers,
Pete
[1] http://en.wikipedia.org/wiki
my brain this morning is blocked on this one
I have a file something like
cpu01 value value value
cpu02 value value value
cpu03 value value value
...
cpu01 value value value
cpu02 value value value
cpu03 value value value
...
cpu01 value value value
cpu02 value value value
cpu03 value va
o IMAP and
SSL, that would be great, too.
Pete
--
Those responsible for the signature have been sacked.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
ssword'; }
and then call sub Password from my main perl script, but that doesn't
seem like "The Right Way To Do It". Should I be using require instead of
use, or something else?
Pete
--
Those responsible for the signature have been sacked.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
fault, and the default perl that comes with AIX has very few modules.
This can cause issues if you try to build the bigger or more conplex
modules such as DBI.
-pete
-Original Message-
From: rjc [mailto:r...@linuxstuff.pl]
Sent: Monday, March 18, 2013 12:09 PM
To: beginners@per
vice, personal anecdotes, or online references, pro or con,
would be greatly appreciated. Thanks.
Pete
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
x27;$command') is not the same as with double
quotes, i.e. system("$command").
With single quotes the $command won't be interpreted. You need double
quotes in this case in order for the date command to be successfully
executed.
Pete
On Nov 10, 2005, at 9:32 AM, <[EMAIL
Hi, I was wondering if someone could point me in the right direction. In
my example below, I have a handler that will parse a contact's name into
another xml node. However, the problem is that when I do this, the
parent node loses an attribute that I am trying to set. Here is example
output:
[EM
ake line for
editable? i.e. right now, line 4 prints out "Edit this", but I can't use
the cursor to delete or modify "Edit this". Is there a way to toggle
this behavior on and off?
Pete
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
How do you determine which pair(s) of words to group together? Are you
always grouping items 3 and 4, or might you sometimes want "monkey
killed" or "killed elephant" or "with stone" ? There needs to be some
way of determining when to pull out a pair and when not to.
[EMAIL PROTECTED] wrote:
b
$4\n";
print "\$5 --> $5\n";
yields these results:
$1 --> ^7Kore^7Adam
$2 --> killed
$3 --> BEST I TEST
$4 --> by
$5 --> MOD_MACHINEGUN
If "by" is always consistent, it's a bit easier, drop it from the regex
altogether: $text=~/^(.*) ($action
t($_), " messages in ", $_, "\n";
}
$imap->close();
and it moans that I'm not connected on the $imap->login() line.
Can anyone help me make it go? Thanks in advance.
Pete
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
> if ($result eq $file1)
This is checking to see if each line matches the filename itself, not the
contents of file1. You were going for the contents of $file1, correct?
Here's my stab. Read in the target files first, then match.
When it walks through the source file, it will print out the name
, and the $ENV{SCRIPT_FILNEAME} reflects the fact that
it's test2.pl, even though it's a symlink to test.pl
You may need that Options line in your
section or similar.
Pete
On Thu, 2003-01-23 at 11:24, Harry Putnam, edited by me for brevity,
wrote:
> I hoped to have one real cgi
if ($numexs=~/^\d+$/) {
# do this if $numexs contains 1 or more numbers, nothing else
} else {
}
Your regex just checks to make sure there's one number in your entire
string. Anchor it at the beginning and the end, and then use a + to say
"one or more occurances of" ...
if ($numexs=~/^[0-9]+$
I'd be tempted to use a hash of hash of hashes, storing it like this:
$hash{$city}{$station}{add1}=$address1
$hash{$city}{$station}{add2}=$address2
$hash{$city}{$station}{state}=$state
$hash{$city}{$station}{zip}=$zip
$hash{$city}{$station}{phone}=$phone
So my loop would look like this:
foreach my
The error results of useradd appear to go to STDERR instead of STDOUT.
You can redirect them to STDOUT, and therefore capture the results, like
this:
my $username='username';
my $rescmd=`/usr/sbin/useradd -s /bin/false $username 2>&1`;
chomp $rescmd;
print "Result is $rescmd\n";
On Fri, 2003-01-3
Here's a sample. The trick is to turn on autoflushing ($|=1;) so that
your text gets printed out right away.
#!/usr/bin/perl -w
use strict;
use CGI qw(:standard);
$|=1;
print header;
print start_html;
for (my $i=0; $i<100; $i++) {
print ".";
sleep 1;
}
print "\n";
print end_html;
On Fri
Dan,
Here's my solution. I'm not capturing the days, hours, minutes, seconds
as I go, but I'm sure you can see how to if it's really necessary.
#!/usr/bin/perl -w
use strict;
my @list=('3d4h45m12s', '3h', '5h2m');
foreach (@list) {
my $seconds=0;
my $string=$_;
while ($string=~s/(\
perldoc -q sort
foreach $empNo (sort {$a<=>$b} keys %empName) {
On Tue, 2003-02-04 at 08:17, Rob wrote:
> Hi, I want to sort a hash based on the employee number; I used a foreach
> loop but it sorts the hash based on the ascii value. How would I get it
> to sort on integer values?
--
To unsu
You probably have the module you need already installed.
I did it successfully like this:
perl -e 'use Math::Complex; print log(-2.8e-05);'
On Wed, 2003-02-05 at 11:41, [EMAIL PROTECTED] wrote:
> hi all,
> i am using perl 5.8.0 on ix86. i was using an inbuilt function log().
> i am not able to g
On Wed, 19 Feb 2003, Scott, Deborah wrote:
> Does anyone know where I can get a script that looks into the contents of a
> directory and outputs the contents of the directory into a list that is
> displayed on an HTML page? (Also, the names should contain hyperlinks to
> those contents.)
Deborah,
I'm not sure what might be the best way to approach this. I'm not comfy
> with an indefinite loop, where if there is some problem removing the lockfile,
> my program would wait forever. I'd rather try for a few minutes, then exit
> with some error.
>
> Any pearls of
There are probably oodles of ways of doing this.
Here are two:
# An array slice
@[EMAIL PROTECTED];
or
# start at position 0, remove 9 elements
splice @data, 0, 9;
Pete
On Tue, 2003-02-25 at 14:39, dan wrote:
> onwards. My way of doing this was:
> shift(@data); x 9
--
To unsubscr
#!/usr/bin/perl -w
use strict;
my @list = qw(fred joe bob john dude eddie rob dudette joeshmoe);
foreach (@list) {
print "$_\n" if (/joe|dude/);
}
Note that you'll match on dudette and joeshmoe ... if you want an exact
match, you could do:
print "$_\n" if (/^joe|dude$/);
On Thu, 2003-02-27 a
unlike
/^(joe|dude)$/. In this case, we can do it either way, but we don't need
to capture anything in the regex, hence the reason why Stefan put that in.
Pete
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
%variable3=(1,2,3,4);
# |SOMETEXT should NOT get matched
open INFILE, $0;
while () {
while (m#([EMAIL PROTECTED])#g) {
print "$1\n";
}
}
close INFILE;
Pete
On Thu, 2003-03-06 at 02:35, Daniel Mueller wrote:
> i'm currently trying to match all variables in a file, t
On Thu, 2003-03-06 at 09:32, Francesco del Vecchio wrote:
> If I have a string as the following:
> a xx b a x b
> and I try a m/a(.*)b/g
> $1 = xx b a x
> what have I to do to obtain two matches each of one give me
> $1 = x
#!/usr/bin/perl -w
u
1 - 100 of 128 matches
Mail list logo