Dave Adams mailto:[EMAIL PROTECTED] wrote:
: Does perl allow you to conditionally include a module?
In general, you can load a module at runtime by using
'require' and manually running its import() sub routine.
require Module;
Module::import( 'Import list' );
: For example:
:
:
Hi,
Does anyone know a perl module that can be used for creating a Messenger
client that really works?
I have tried Net::YahooMessenger but it doesn't work.
Thank you.
Teddy
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Charles K. Clarkson wrote:
Dave Adams mailto:[EMAIL PROTECTED] wrote:
Does perl allow you to conditionally include a module?
In general, you can load a module at runtime by using
'require' and manually running its import() sub routine.
require Module;
Module::import( 'Import list'
Hi folks,
I'm working on a project where I'm given a pool of users and I have to
determine if there are any messages in their spool files, and if so, forward
them on to a new user.
I'm looking for functionality similar to what you get with a .forward file,
only I don't want the messages
Hi Guys,
Can you please look at the below script. The SQL query
works on it's own in separate script. But not when it is put into the
for loop in this script
. Any ideas??
Thanks,
David
.forward is fine for that kind of thing, if you modify it to a pipe
where a perl skript reads from. Then pass the message throw it, while
doing what ever you like with it - for example sleep(3600) in fork / or
threaded spawn of you programm.
MNibble
Rich Fernandez wrote:
Hi folks,
I'm
Few things that I can see. I'm sure others will give you more ideas.
On 7/27/05, David Foley [EMAIL PROTECTED] wrote:
Hi Guys,
Can you please look at the below script. The SQL query
works on it's own in separate script. But not when it is put into the
for loop in this script
Thanks for the reply, but what I need to do is hang onto the messages for an
indefinite period of time, maybe days, during which time the box might get
rebooted, crash, etc. I can't rely on a process sleeping.
richf
-Original Message-
From: MNibble [mailto:[EMAIL PROTECTED]
Sent:
Hi,
it does not seem to be possible to use indirect method invocation with anything
but a scalar. While this works:
my $mode = $parameters{mode};
$item-$mode();
I cannot seem to find a proper bracketing to make this work:
$item-$parameters{mode}();
Is my assumption correct?
My other problem
Is there a way to determine in perl whether the current script was run from
a login shell or not?
- B
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response
Hi,
Jan Eden wrote on 27.07.2005:
In other words, I would like to have something like the %actions
hash to construct a more flexible version of the $item-$mode()
construct, where I can pass different additional parameters to each
method.
I finally came up with something myself:
my %actions = (
Because it's up-side down.
Why is that?
It makes replies harder to read.
Why not?
Please don't top-post. - Sherm Pendley, Mac OS X list
Rich Fernandez wrote:
Thanks for the reply, but what I need to do is hang onto the messages for an
indefinite period of time, maybe days, during which time the
On Jul 27, 2005, at 17:21, Jan Eden wrote:
My other problem is that the cookbook quotes (something like) the
following code as an example for storing method names:
my %actions = (
display = $item-display(),
move_picture = $item-move_picture($item-{id}, $item-
{parameters}-{position}),
On Jul 27, Bryan R Harris said:
Is there a way to determine in perl whether the current script was run from
a login shell or not?
As opposed to what, specifically? I'd say a good place to check is
$ENV{SHELL}. If that's defined, chances are it was run from a shell. I
would not expect it
Jan == Jan Eden [EMAIL PROTECTED] writes:
Jan I finally came up with something myself:
But that's no longer a method call.
You can do an indirect method call, but it needs to be a simple scalar:
my $method = $parameters{mode};
$object-$methods(@args);
--
Randal L. Schwartz - Stonehenge
On 7/27/05, Bryan R Harris [EMAIL PROTECTED] wrote:
Is there a way to determine in perl whether the current script was run from
a login shell or not?
- B
that depends what you mean by login shell. You can use $ENV{SHELL}
to find out what shell, if any, invoked the the current
Thanks for the tips, guys.
The %ENV hash suggestion worked -- I'm actually writing a filter for BBEdit
(OS X) that I also want to work from the command line, and also on IRIX
boxes. Turns out that all CLIs have $ENV{TERM} defined, but within BBEdit
it's not.
But turns out it doesn't matter
I have discovered that my Oracle installation has the DBI.pm module in
it. I really want to use this, but don't know how to have the @INC see
it when I do:
oracle perl -e use DBI;
Can't locate DBI.pm in @INC (@INC contains:
/usr/perl5/5.6.1/lib/sun4-solaris-64int /usr/perl5/5.6.1/lib
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Jay,
You need to set the PERL5LIB path to include the directory of the DBI.pm
module.
Steve
Jay Caviness wrote:
I have discovered that my Oracle installation has the DBI.pm module in
it. I really want to use this, but don't know how to have
Jay Caviness wrote:
I have discovered that my Oracle installation has the DBI.pm module in
it. I really want to use this, but don't know how to have the @INC see
it when I do:
oracle perl -e use DBI;
Can't locate DBI.pm in @INC (@INC contains:
/usr/perl5/5.6.1/lib/sun4-solaris-64int
Hi all,
Can someone pls take a look at the script below and explain what I'm doing
wrong.. The script runs w/out errors but the substitution is not working..
Hopefully the note below will be enough info..
I was able to print the file names that I wanted but once I tried to open
the file
Thanks Wiggins,
As far as reading the message in,
parsing it, and then forwarding it, I guarantee the Mail::Box
suite can
handle what you want, but it does have a learning curve.
You are right, I did not read the doco carefully enough. Sorry.
Sorry I can't provide source what I wrote was
Brian Volk wrote:
Hi all,
Hello,
Can someone pls take a look at the script below and explain what I'm doing
wrong.. The script runs w/out errors but the substitution is not working..
Hopefully the note below will be enough info..
I was able to print the file names that I wanted but
Dave Adams wrote:
Does perl allow you to conditionally include a module?
For example:
#!/usr/bin/perl -w
use strict;
my $DEBUG = 0;
if (DEBUG) {
use diagnostics;
}
my $filename = test$$.txt;
open (FH , $filename) || die error: $!;
print (FH hi);
close (FH);
Although this is a simple and
Scott R. Godin wrote:
Dave Adams wrote:
Does perl allow you to conditionally include a module?
For example:
#!/usr/bin/perl -w
use strict;
my $DEBUG = 0;
if (DEBUG) {
use diagnostics;
}
my $filename = test$$.txt;
open (FH , $filename) || die error: $!;
print (FH hi);
close (FH);
I'm writing a module called IRC::Client which I expect to be The Next Big
Thing when it comes to Perl and IRC (if not IRC altogether!). The module
abstracts the concepts related to IRC into objects, such as Channel, User,
Server, Client. The goal is to make an IRC module that can be used to
On 7/27/05, Rich Fernandez [EMAIL PROTECTED] wrote:
Thanks Wiggins,
As far as reading the message in,
parsing it, and then forwarding it, I guarantee the Mail::Box
suite can
handle what you want, but it does have a learning curve.
You are right, I did not read the doco carefully
David Van Ginneken mailto:[EMAIL PROTECTED] wrote:
: : #Get and process mail
: : for my $messageID (90){
: What exactly is this supposed to do? If you just run this
: for my $messageID (90){
: print $messageID . \n;
: }
: It outputs nothing..
Actually, it outputs 90\n. There is no reason
Bryan R Harris wrote:
Is there a way to determine in perl whether the current script was run from
a login shell or not?
if(-t STDIN) {
print Hello terminal\n;
} else {
print Content-type: text/html\n\n;
print Hello bBrowser/b\n;
}
HTH :)
--
To unsubscribe, e-mail: [EMAIL
Octavian Rasnita wrote:
Hi,
Does anyone know a perl module that can be used for creating a Messenger
client that really works?
I have tried Net::YahooMessenger but it doesn't work.
Have you searched cpan for the messenger you want to use?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For
Hi,
Can someone explain the difference between backticks and system when
evaluated in this if statement:
sub getDate {
print start date\n;
if ( system(/bin/date) ) {
print can't get date\n;
exit(2);
}
print finish date\n;
}
Returns the following:
start date
Thu Jul 28 12:13:59 EST
Keenan, Greg John (Greg)** CTR ** wrote:
Hi,
Can someone explain the difference between backticks and system when
evaluated in this if statement:
The difference really isn't specific to this context, it is the inherent
difference between the two that is affecting the outcome.
perldoc -f
On Jul 28, Keenan, Greg John (Greg)** CTR ** said:
sub getDate {
print start date\n;
if ( system(/bin/date) ) {
print can't get date\n;
exit(2);
}
print finish date\n;
}
system() executes a command, and returns the shell's error code. 0
indicates success, non-0 indicates failure. It
--
# file already sorted by $id
my $cur_id = '';
while (F) {
chomp;
($id,$score,$bal) = split (/,/, $_);
next if $cur_id == $id;
print OUT $id,$score,$bal\n;
$cur_id = $id;
}
Don't fix it if it's not broken. :-)
Thanks John and Jeff. Just
34 matches
Mail list logo