Where are you getting the hours from? A file, localtime(), etc.?
-Original Message-
From: Mariusz
To: perl
Sent: 3/18/02 10:56 PM
Subject: time calculation
What's the best way to find the difference in hours between
$checkin_time and $checkout_time?
I thought each hour from 12am throu
What's the best way to find the difference in hours between $checkin_time and
$checkout_time?
I thought each hour from 12am through 12pm would supply integer from 0 to 24 (e.g. 9am
to 5pm is 17-9=8) but that does work except when checkout is 12am.(I don't have to
deal with minutes in this scrip
Hi,
Does anyone know any what to connect to an Microsoft Exchange server via
perl ?
I have tried some modules "Net::IMAP::Simple" and "Mail::IMAPClient" but
they doesn´t work for me.
Regards
Mikael Larsson
Jess Balint wrote:
>
> Hello all, I have a file of 3,210,008 CSV records. I need to take a random
> sample of this. I tried hacking something together a while ago, but it
> seemed to repeat 65,536 different records. When I need a 5mil sample, this
> creates a problem.
>
> Here is my old code: I
Um, let me clarify -- I parse the sql that is bracketed by BEGINSQL
and ENDSQL and feed it to DBI for execution.
-Joe
--- Peter Scott <[EMAIL PROTECTED]> wrote:
> At 01:13 PM 3/18/02 -0800, Joe Raube wrote:
> >I have a file that contains, among other things, SQL that is
> >bracketed by BEGINSQL
I have been working on this script for a little while and hope that I can
find some fresh eyes to look at it.
I create a list then use the list to create the directories. Once the
directories are created I would like to recurse the files into the
directories that they are coming from ( this is a
Monday, March 18, 2002, 10:28:14 PM, "Jonathan E. Paton" wrote:
> Even if it doesn't it solves the problem of having
> duplicates. Then you can shuffle elements to get
> your data set. There must be a decent shuffle
> algorithm someplace, since I haven't thought of
> one yet. splicing to pop
> "Kevin" == Kevin Zembower <[EMAIL PROTECTED]> writes:
Kevin> I'm wondering if a module exists to check an email address in real time.
No, because it can't be done, in general, as stated repeatedly here,
in FAQ lists, and in newsgroups.
--
Randal L. Schwartz - Stonehenge Consulting Servic
I would like to be able to read hdlist. I use my own RPM updater, and
I'd like to start doing things the right way.
--
Shawn Leas
[EMAIL PROTECTED]
I saw a subliminal advertising executive, but only for a second.
-- Stephen Wright
--
To unsubscri
On Mar 18, [EMAIL PROTECTED] said:
>Can any one tell me how can I get the group_id and user_id in perl and store
>it in a veriable. I am really stressing my self out... thanks in advance.
Perl already gives you $< (the user ID) and $( (the group ID).
$uid = $<;
$gid = $(;
--
Jeff "japhy"
Can any one tell me how can I get the group_id and user_id in perl and store
it in a veriable. I am really stressing my self out... thanks in advance.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
From: "Jay M" <[EMAIL PROTECTED]>
> I am attempting to modify a script that was coded back when perl 4.xx
> was the current version. This script accesses databases using DB_File
> and dbmopen(). After every dbmopen and dbmclose there is a flock().
> For example.
>
> dbmopen(%DB, $filename, 0777
Hi,
I am attempting to modify a script that was coded back when perl 4.xx was
the current version. This script accesses databases using DB_File and
dbmopen(). After every dbmopen and dbmclose there is a flock(). For
example.
dbmopen(%DB, $filename, 0777) || die "Error: $!\n";
flock(DB,2);
#i
> Forgive me for such a basic question,
> I'm brand spanking new to Perl and
> programming in general.
The banner on the door says:
"beginners@perl"
so I guess we should say 'Welcome Friend' :)
> This is from the exercises in "Learning
> Pearl", chapter> 6, exercise 1.
s/Pearl/Perl/; # Thi
> Hello all, I have a file of 3,210,008 CSV
> records. I need to take a random sample of
> this. I tried hacking something together a
> while ago, but it seemed to repeat 65,536
> different records. When I need a 5mil
> sample, this creates a problem.
>
> Here is my old code: I know the logic
> a
At 01:13 PM 3/18/02 -0800, Joe Raube wrote:
>I have a file that contains, among other things, SQL that is
>bracketed by BEGINSQL and ENDSQL.
>
>I have written perl code that parses this out and executes it, and it
>is working for 99% of the cases.
Sounds like you just reinvented a fairly large wh
Hi Paul,
(1) The m aterial referred to forms some of the chapters of Conway's
book
(2) The contents of the book are available from
http://www.manning.com/conway
There are Sample Chapters 4 and 11 available in pdf. I think it is a
good book to start learning OO and its implementation in perl.
T
Hello all, I have a file of 3,210,008 CSV records. I need to take a random
sample of this. I tried hacking something together a while ago, but it
seemed to repeat 65,536 different records. When I need a 5mil sample, this
creates a problem.
Here is my old code: I know the logic allows dups, but wh
Forgive me for such a basic question, I'm brand spanking new to Perl and programming
in general.
This is from the exercises in "Learning Pearl", chapter 6, exercise 1.
The goal is to reverse the order of all the lines of a specified file.
The very simple answer given in the book is as follow
> I have a file that contains, among
> other things, SQL that is
> bracketed by BEGINSQL and ENDSQL.
>
> I have written perl code that parses
> this out and executes it, and it is
> working for 99% of the cases.
>
> I am getting some SQL though that
> spans multiple lines.
>
> How can I parse o
From: Joe Raube <[EMAIL PROTECTED]>
> I have a file that contains, among other things, SQL that is
> bracketed by BEGINSQL and ENDSQL.
>
> I have written perl code that parses this out and executes it, and it
> is working for 99% of the cases.
>
> I am getting some SQL though t
From: Elaine -HFB- Ashton <[EMAIL PROTECTED]>
> siren jones [[EMAIL PROTECTED]] quoth:
> *>Is it possible to use LWP::Simple to retrieve a binary file (i.e. a
> .netCDF *>file)? Using the following code I can retrieve what I'm
> guessing are parts *>of the file. That is, what i
I'm wondering if a module exists to check an email address in real time.
I would use the module in a web page signup for a mailing list. After
the user submitted her email address, she'd see a page asking her to
wait for up to two minutes. During this time, the module could check if
the host name
On Mar 18, Richard Pfeiffer said:
>Good Afternoon,
I have bad news for you. Your subject leads me to this statement: "it
doesn't work that way."
>I have a string that has various white space
>(tabs, spaces, etc) at the end of it. I want to
>find the last real char [0-9a-zA-Z] and then use
>c
I think you can use gethostbyaddr() for this.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 18, 2002 1:19 PM
To: [EMAIL PROTECTED]
Subject: DNS lookup
I need to find a way to do a DNS lookup of a list of ips (at least 250
entries), get their
Check out pack() and unpack() for converting the values.
-Original Message-
From: Tim Musson [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 18, 2002 12:15 PM
To: [EMAIL PROTECTED]
Subject: Bit reversal of MAC Address bytes...
hey perl guru's,
I have need to do a bit reversal of a MA
> 1. How do I brake the MAC Address up into bytes?
I'm not exactly sure what format you're getting the MAC address in, but
it looks like you're just splitting it into two-character chunks... To
split that, you could do:
my $c = 0;
while($mac =~ /(.{2})/g){
$mac[$c++] = $1;
}
> 2. How to c
I need to find a way to do a DNS lookup of a list of ips (at least 250
entries), get their corresponding hostnames and produce a report.
It sounds very simple, an I implemented it with "nslookup ip" (loop for 250
times).
I tried "host -al" (which produces a long list of host, so that with PERL
on
I have a file that contains, among other things, SQL that is
bracketed by BEGINSQL and ENDSQL.
I have written perl code that parses this out and executes it, and it
is working for 99% of the cases.
I am getting some SQL though that spans multiple lines.
How can I parse out this case?
Thanks.
Thanks. Looks like I'll give it a try. I came across an excellent
tutorial:
http://www.extropia.com/tutorials/perl5/oop.html
I recomend this as a place to start for any beginner.
I have the Cookbook, and although it is excellent in most parts,
its treatement of oop is confusing, unless you are
> I am receiving a strange error on exiting a script: Attempt
> to free unreferenced scalar during global destruction. It
> only occurs after I make a DBI connection and run an SQL
> statement. I am undefing the statement handle and
> disconnecting the database handle. Does anyone have a cl
Monday, March 18, 2002, 7:21:51 PM, John W. Krahn wrote:
> perldoc perldiag
> [snip]
> Attempt to free unreferenced scalar
> (W internal) Perl went to decrement the reference
> count of a scalar to see if it would go to 0, and dis
> covered that it had already gone to 0 earlier, and
hey perl guru's,
I have need to do a bit reversal of a MAC address (some Token Ring to
Ethernet thing) and am stumped.
Cisco has an app on their web site if you can log in, but not
everyone can log in, and I am not always attached...
So I was thinking I would build one myself, but not
You can remove the whitespace at the end of a line with this regex...
$text =~ s/\s+$//;
It matches one or more whitespace chars at the end of the line and replaces
them with nothing.
Rob
-Original Message-
From: Richard Pfeiffer [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 18, 2002
On Mon, 2002-03-18 at 14:41, Jonathan E. Paton wrote:
> > I grepped the source code for undef and
> > only got back these lines.
> >
> > app.pm: $sth = undef;
> > app.pm: $sth = undef;
> > app.pm: local($/) = undef;
> > app.pm: return undef;
> > app.pm: return undef;
>
Good Afternoon,
Wondering if anyone could help me with this or
enlighten me on another way to go about it.
I have a string that has various white space
(tabs, spaces, etc) at the end of it. I want to
find the last real char [0-9a-zA-Z] and then use
chop or chomp to remove the whitespace.
I've
> I grepped the source code for undef and
> only got back these lines.
>
> app.pm: $sth = undef;
> app.pm: $sth = undef;
> app.pm: local($/) = undef;
> app.pm: return undef;
> app.pm: return undef;
> app.pm: return undef;
> app.pm: $row =
> > I am undefing the statement handle and
> > disconnecting the database handle. Does anyone
> > have a clue what this might be?
>
> perldoc perldiag
> [snip]
> Attempt to free unreferenced scalar
> (W internal) Perl went to decrement the
> reference count of a scalar to see if it
>
On Mon, 2002-03-18 at 14:21, John W. Krahn wrote:
> Chas Owens wrote:
> >
> > I am receiving a strange error on exiting a script: Attempt to free
> > unreferenced scalar during global destruction. It only occurs after I
> > make a DBI connection and run an SQL statement. I am undefing the
> > s
> I know this must be a stupid question but:
It is not! :)
> Let's suppose I am matching for one of
> multiple matches. Is it better/faster to
> split it into several pattern matches or
> just keep it one match?
>
> ie: which would be better/faster?
If matches can usually be found near
the be
Chas Owens wrote:
>
> I am receiving a strange error on exiting a script: Attempt to free
> unreferenced scalar during global destruction. It only occurs after I
> make a DBI connection and run an SQL statement. I am undefing the
> statement handle and disconnecting the database handle. Does a
On Mon, 2002-03-18 at 13:05, Jonathan E. Paton wrote:
> > I am receiving a strange error on exiting a
> > script: Attempt to free unreferenced scalar
> > during global destruction. It only occurs after
> > I make a DBI connection and run an SQL statement.
> > I am undefing the statement handle a
siren jones [[EMAIL PROTECTED]] quoth:
*>Is it possible to use LWP::Simple to retrieve a binary file (i.e. a .netCDF
*>file)? Using the following code I can retrieve what I'm guessing are parts
*>of the file. That is, what is retrieved is always 3871 bytes even though
*>the file is actually m
Hi,
I have an admin script and i want all STAFF to have the ability to save
their files into their Home Computer on their C: or Floppy disk (A:) in case
the webserver closes or crashes. SO that someone has the Files.
Anthoy
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands
>> 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:36 +
I know this must be a stupid question but:
let's suppose I am matching for one of multiple matches.
Is it better/faster to split it into several pattern matches or just keep it
one match?
ie: which would be better/faster?
/:\s*$|^\n$|\*|etc/;
/:\s*$/ || /^\n$/ || /\*/ || /etc/
and just for k
Marlon,
Thanks, I'd not considered that. I was just doing some preliminary I/O
research and testing to broaden my knowledge of some of the bits 'n bytes of
Perl, I wasn't planning on anything as fancy as an automated telnet session.
However, now that you've raised the idea
Still, there has t
> I am receiving a strange error on exiting a
> script: Attempt to free unreferenced scalar
> during global destruction. It only occurs after
> I make a DBI connection and run an SQL statement.
> I am undefing the statement handle and
> disconnecting the database handle.
use DBI;
> Does anyone
If you're trying to automate a console session, you may consider using the
Expect perl module. I haven't used every function, but the expect and send
functions seem to work well and that's usually all you need. Keeps me from
having to use tcl ;-)
> -Original Message-
> From: John [mailto:
I am receiving a strange error on exiting a script: Attempt to free
unreferenced scalar during global destruction. It only occurs after I
make a DBI connection and run an SQL statement. I am undefing the
statement handle and disconnecting the database handle. Does anyone
have a clue what this m
we assume you mean to save a file to the webserver's drive, not the
webserver client's drive.
On Monday, March 18, 2002, at 01:28 AM, Johannes Franken wrote:
> * anthony <[EMAIL PROTECTED]> [2002-03-18 09:45 +0100]:
>> Is it possible to save files from the webserver to the c: or a: drive?
>> o
I don't quite know where to begin... Was the AIX box running ancient
version of perl? I'm not surprised this won't compile. There's already
been one response, so I'll try to stick to what hasn't been said,
implementing the changes mentioned in the previous mail.
> # !/usr/bin/perl
>
> # !Mo
> only just for you ... (next time for the public)
This time for the public, just watch what you say
privately as well as publicly. Plenty of people
have been offended this way to slightly disappear
from their regular IRC/Mailing list haunts.
> 1. Data References and Anonymous Storage
>
> You
There's definitely something missing here. It looks like that line should
be shelled out using system() or backticks ``. Without them, Perl will
think you're trying to do a match on /usr/, which is why it stops at
netscape. I have no idea how this could have worked before.
-Original Mess
The problem might be that the getstore() expects character data, I'm not
sure. What you can do is store it yourself, and force binary mode for the
filehandle.
#!/usr/gin/perl -w
use strict;
use LWP::Simple;
# untested
my $bin_data = get ('http://www.netcdf_url');
open OUT, '> filename';
binmod
Hi all,
Please don't respond directly to that last email I sent. It has an
incorrect email address on it that isn't checked that often. Please post
back to the list directly or to [EMAIL PROTECTED]
Thanks,
-dave
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:
Is it possible to use LWP::Simple to retrieve a binary file (i.e. a .netCDF
file)? Using the following code I can retrieve what I'm guessing are parts
of the file. That is, what is retrieved is always 3871 bytes even though
the file is actually much larger. Worse, I can not read the .netcdf
> Any ideas??
> =
> # !/usr/bin/
This should be #!/usr/bin/perl (no space between # and !, complete path
to perl on your machine)
> # !Monthly Access log reporting!
>
> chdir "/usr/netscape/server4/bin/https/lib" or die "Can't cd to
>
> Ok, I'm on a Linux box here. and I do have
> Data::Dumper.
:)
> So how would the solution with Dumper work?
> There is not very much documentation on Dumber
> in "the camel"...
s/Dumber/the smarter way/;
I suggest you search via your favourite search
engine, or if you don't mind reading a li
ok, im on a linux box here. and i do have Data::Dumper.
so how would the solution with Dumper work? theres not very much documentation on
Dumber in "the camel"...
martin
> I suggest Data::Dumper, which can do exactly this
> function.
>
--
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For a
Hi all
Recently, I was handed the job of converting all our perl from an AIX 4.2
box to our Linux 6.2. Never having worked with perl, I have run into a
problem that I can't seem to solve.
The perl below cancels on the line
"/usr/netscape/server4/extras/flexanlg/flexanlg -n $server -m $logna
--howdy:
--i did download and install the, er,
installer 2.0 for windows '98 (it's called
InstMsiA).
--it installs and reboots the system,
but when i try to install ActivePerl 5.6.1
behind that, i get a messages that says
something like, 'Can't install'.
--i'm sorry i don't have the exact error
On Sun, 17 Mar 2002 08:44:12 -0500, [EMAIL PROTECTED] (Gkotsovilis) wrote:
>How do you keep line numbering straight in a perl script.
A cool way is to use an undocumented module called
Filter::NumberLines
Here's the URL of this filter:
http://www.perlmonks.org/index.pl?node_id=125831
It let
> If it's that big you might want to 'tie' the hash
> to a DB file. But it's too early in morning for
> me to go into explaining how. anyone want to jump
> in on this?
Don't know enough to be able to implement something
that works for him. Platform etc.
I suggest Data::Dumper, which can do exa
hi
i have some files of the format:
{
'key1' = 'value2',
'key2' = 'value3',
'key3' = 'value4',
'key4' = 'value5',
'key5' = 'value6',
}
the values are large huge chunks of text.
how can i import such a file into a perl script as a hash?
and how can i write the hash to a new file (same format as
Jenda,
Thanks for a very impressive answer.
Angus
-Original Message-
From: Jenda Krynicky [mailto:[EMAIL PROTECTED]]
Sent: 18 March 2002 12:05
To: Laycock, Angus; [EMAIL PROTECTED]
Subject: RE: @ARGV question
From: "Laycock, Angus" <[EMAIL PROTECTED]>
> $ARGV[$count] represents the in
From: "Laycock, Angus" <[EMAIL PROTECTED]>
> $ARGV[$count] represents the index of the array. I am passing in
> parameters and some contain space between two words and I noticed that
> using while (<@ARGV>) it loops the exact amount of times per words,
> not per parameter.
I see. So you wanted
From: "Laycock, Angus" <[EMAIL PROTECTED]>
To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
Subject:@ARGV question
Date sent: Mon, 18 Mar 2002 10:56:39 -
> Hi There.
>
> I have this piece of code which I call with the following;
Jonathan,
Thanks for your help. I just want the info in the parameters that I was
passing and changing it to foreach loop has done the job. I just assumed the
while loop would do what I wanted.
Thanks for your help again.
Angus
-Original Message-
From: Jonathan E. Paton [mailto:[EMAI
> $ARGV[$count] represents the index of the
> array. I am passing in parameters and some
> contain space between two words and I noticed
> that using while (<@ARGV>) it loops the exact
> amount of times per words, not per parameter.
> So if I passed "Hi There" it goes around the
> loop twice rathe
Jonathan,
$ARGV[$count] represents the index of the array. I am passing in parameters
and some contain space between two words and I noticed that using while
(<@ARGV>) it loops the exact amount of times per words, not per parameter.
So if I passed "Hi There" it goes around the loop twice rather t
> while (<$ARGV>) {
> print "count $count $ARGV[$count]\n";
> $count++;
> }
What is $ARGV[$count]? Is it supposed to be
the line of the file?
Either use:
my @file = ;
foreach my $line (@file) {
print 'count' . $count++ . $_ . "\n";
}
Or:
while () {
print "count $. $
> > (1) Could someone tell me if this in fact
> > is from the same book?
> >
> > From what I read on this site, I was not
> > too impressed with the book at all. It
> > seemed to go on forever explaining theory
> > without giving any concrete examples with
> > perl code.
"This is a series of extr
Hi There.
I have this piece of code which I call with the following; array.csh "one"
"two" "three four" "five" "sic cod"
#!/opt/perl-5.6.1/bin/perl -w
$count=0;
print " ARGV $#ARGV\n\n";
while (<$ARGV>) {
print "count $count $ARGV[$count]\n";
$count++;
}
I get the following out
In my opinion, the balanace between theory and technique in the book is good, you
really can't expect a book about object oriented to be without any theory at all right?
I was very fresh on OO perl when I first read the book and I did found a lot of good
tips and advice from it. If you are too
* anthony <[EMAIL PROTECTED]> [2002-03-18 09:45 +0100]:
> Is it possible to save files from the webserver to the c: or a: drive?
> open(USER, ">$path\news.db") || die errorPage("Could not open
\n gets interpolated to a newline, which is legal for a filename but
hopefully not what you expected.
O
I finished *Learning Perl*(The O'Reilly book), and thought it one of the best books
relating to a linux subject I have yet read.
(I know that many people on this mailing list probably use Windows. If you are a linux
user and have had to suffer through some of the awful documentation on various
Hi,
Is it possible to save files from the webserver to the c: or a: drive?
i have a script that ask for the path to the drive.
$path. and my script does the following.
open(USER, ">$path\news.db") || die errorPage("Could not open
$dataDir/user.db: $!");
print USER @news;
close USER;
Regards,
A
78 matches
Mail list logo