John Ackley wrote:
> Inherited code (from Verisign): @[EMAIL PROTECTED] = split /\t/,$rec;
> which worked but really puzzled me.
What is happening is a hash slice assignment similar to:
@datafield{ 'a', 'b', 'c' } = ( 'd', 'e', 'f' );
Where the first element in @send is used as the key for the
On 4/1/06, Bryan Harris <[EMAIL PROTECTED]> wrote:
snip
> This looks very interesting... I downloaded it, but I have no idea how to
> install it, though. I'm a modules-idiot. I tried putting the .pm file in
> the current directory and putting "use TimeTick.pm;" at the beginning of my
> code, but
Dear all,
Here is a code which use Getopt::Long to produce a help instruction.
As can be seen below, I also want my code to print out the help message
when no argument is passed.
My question are:
1. How can I make the code below return man page when I simpy do:
$ perl mycode.pl
Namely no
Hi,
I've never used IO::Tee module and I would like to have the same thing
like tee -a on Unix system...
Do you have some example of how to use it ?
Regards,
--
. ''`. (\___/) E d i S T O J I C E V I C
: :' : (='.'=) http://www.debianworld.org
`. `~' (")_(") GPG: C360 FCF0 AB3A 2AB0
In article <[EMAIL PROTECTED]>, Bryan Harris
<[EMAIL PROTECTED]> wrote:
> I have a script that takes ~5 seconds to run, but I'd like to get it down to
> <1 sec. My problem is I don't know which part is the slow part. So given
> something like this:
You don't have to modify your code to profile
On Sun, 02 Apr 2006 09:11:13 -0700, Bryan Harris wrote:
>> On Sat, 01 Apr 2006 09:29:47 -0700, Bryan Harris wrote:
>>> This looks very interesting... I downloaded it, but I have no idea how
>>> to install it, though. I'm a modules-idiot. I tried putting the .pm
>>> file in the current directory
On 3/31/06, John W. Krahn <[EMAIL PROTECTED]> wrote:
> Mr. Shawn H. Corey wrote:
> > On Fri, 2006-31-03 at 14:41 -0700, Bryan Harris wrote:
> >>I have a script that takes ~5 seconds to run, but I'd like to get it down to
> >><1 sec. My problem is I don't know which part is the slow part. So given
On 4/3/06, Edward WIJAYA <[EMAIL PROTECTED]> wrote:
> 1. How can I make the code below return man page when I simpy do:
> $ perl mycode.pl
>
> Namely no param is passed here.
unless (@ARGV) {
# no command-line args
pod2usage(-verbose => 2);
exit;
}
> 2. Ve
On 4/3/06, Edi STOJICEVIC <[EMAIL PROTECTED]> wrote:
> I've never used IO::Tee module and I would like to have the same thing
> like tee -a on Unix system...
>
> Do you have some example of how to use it ?
Do you need more of an example than what's in the documentation?
http://search.cpan.or
Dear Perl community,
I need to re-sort a set of data. I think that the below example is self
explained; so which Perl structure should I use to handle this dataset?
Thanks in advance for any suggestion, Andre
2;John;Apple;Banana
3;Andrew;Pear;Apple;Melon;Orange
8;Susan;Pear;Melon
2;John;App
On 4/3/06, Andrej Kastrin <[EMAIL PROTECTED]> wrote:
> I need to re-sort a set of data. I think that the below example is self
> explained; so which Perl structure should I use to handle this dataset?
Perl has two data structures. Arrays hold items in order, while hashes
keep track of their data
What is the correct method to authenticate for sending mails , I found
auth(). But its not working...
Mr. Shawn H. Corey wrote:
> On Sat, 2006-01-04 at 09:57 -0500, Frank Bax wrote:
>> I'm not the OP, but I have a script with a similar problem. The
>> script has some logic that generates many (thousands of billions) of
>> combinations from a little bit of data and only the best 100 combos
>> are o
Sonika Sachdeva wrote:
What is the correct method to authenticate for sending mails , I found
auth(). But its not working...
Try
Mail::Sender::Easy
It handles SMTP authentication quite nicely :)
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTE
On 4/1/06, Frank Bax <[EMAIL PROTECTED]> wrote:
> At 06:59 PM 3/31/06, Mr. Shawn H. Corey wrote:
>
> >On Fri, 2006-31-03 at 15:45 -0800, Tom Phoenix wrote:
> > > You should loop over the input, pushing each item on to an array. If
> > > at any time you have 2000 items in the array, sort them and di
Andrej Kastrin wrote:
> Dear Perl community,
Hello,
> I need to re-sort a set of data. I think that the below example is self
> explained; so which Perl structure should I use to handle this dataset?
>
> Thanks in advance for any suggestion, Andre
>
>
> 2;John;Apple;Banana
> 3;Andrew;Pear;Appl
Andrej Kastrin schreef:
> I need to re-sort a set of data. I think that the below example is
> self explained; so which Perl structure should I use to handle this
> dataset?
>
> Thanks in advance for any suggestion, Andre
>
>
> 2;John;Apple;Banana
> 3;Andrew;Pear;Apple;Melon;Orange
> 8;Susan;Pear;
based upon the string in a variable, I want to run a particular
subroutine:
my $var='cat';
$var='fish';
&$var; # I want to run fish if $var is a fish or cat if $var is a cat...
sub cat { };
sub dog { };
sub fish { };
For some reason I think I'll be told thi
On 4/3/06, The Ghost <[EMAIL PROTECTED]> wrote:
> based upon the string in a variable, I want to run a particular
> subroutine:
One way to do this (without the dreaded soft reference) is to have a
lookup table:
my %table = (
cat => \&cat,
jackalope => \&jackalope,
yet
> On 4/1/06, Bryan Harris <[EMAIL PROTECTED]> wrote:
> snip
>> This looks very interesting... I downloaded it, but I have no idea how to
>> install it, though. I'm a modules-idiot. I tried putting the .pm file in
>> the current directory and putting "use TimeTick.pm;" at the beginning of my
>>
On Mon, 2006-03-04 at 15:41 -0500, The Ghost wrote:
> based upon the string in a variable, I want to run a particular
> subroutine:
>
> my $var='cat';
>
>
>
> $var='fish';
>
> &$var; # I want to run fish if $var is a fish or cat if $var is a cat...
>
> sub cat { };
> sub do
Hi
Anyone know of a way to create a loop (or something similar) that
automatically schedules the execution of a sub-routine periodically from
within a program, for example execute check() every 600 seconds or the
like? The program would be running as a daemon on the host.
Thanks
James Turn
James Turnbull wrote:
Hi
Anyone know of a way to create a loop (or something similar) that
automatically schedules the execution of a sub-routine periodically
from within a program, for example execute check() every 600 seconds
or the like? The program would be running as a daemon on the hos
Your best bet is to use a cron job for this. Otherwise, you'd waste server
resources. What happens when the process is killed or the server restarted?
On 4/3/06, James Turnbull <[EMAIL PROTECTED]> wrote:
>
> Hi
>
> Anyone know of a way to create a loop (or something similar) that
> automatically s
On 4/3/06, James Turnbull <[EMAIL PROTECTED]> wrote:
> The mainline program is monitoring something - every x seconds I wish to
> execute a subroutine from within the mainline and return to the mainline
> after executing the subroutine to continue the monitoring.
So, it sounds as if you want your
On Tue, 2006-04-04 at 12:52 +1000, James Turnbull wrote:
> James Turnbull wrote:
> > Hi
> >
> > Anyone know of a way to create a loop (or something similar) that
> > automatically schedules the execution of a sub-routine periodically
> > from within a program, for example execute check() every 60
Mr. Shawn H. Corey wrote:
First question: are you running under M$ Windows or UNIX?
Unix - Linux or BSD generally
Second question: does this periodic function relying on data of the main
process?
Yes - it uses a hash defined in the mainline.
Regards
James Turnbull
--
To unsubscribe,
I wanted to use a hash slice, but I'm using a hashref. Can I do both?
my @current_Flags=( $hormone . 'DoseCycle', anotherVar,
somethingElse );
$flags->[EMAIL PROTECTED]>selectrow_array(qq{$SQLstmt});
#returns an array, $flags is my hashref
Thanks!
--
To unsubscribe, e-mail: [EMAIL PROTE
"Tom Phoenix" schreef:
> my %table = (
> cat => \&cat,
> jackalope => \&jackalope,
> yeti => \&yeti,
> );
An alternative is to build that with eval:
my %table;
eval '$table{' . $_ . '} = \&' . $_
for qw(cat jackalope yeti);
--
Affijn, Ruud
"Gewoon is een t
Ryan Perry wrote:
> I wanted to use a hash slice, but I'm using a hashref. Can I do both?
Yes.
> my @current_Flags=( $hormone . 'DoseCycle', anotherVar, somethingElse );
> $flags->[EMAIL PROTECTED]>selectrow_array(qq{$SQLstmt}); #returns
@{ $flags }{ @current_Flags } = $dbh->selectrow_array-
James Turnbull wrote:
> Hi
Hello,
> Anyone know of a way to create a loop (or something similar) that
> automatically schedules the execution of a sub-routine periodically from
> within a program, for example execute check() every 600 seconds or the
> like? The program would be running as a daem
On 4/3/06, Dr.Ruud <[EMAIL PROTECTED]> wrote:
> my %table;
> eval '$table{' . $_ . '} = \&' . $_
>for qw(cat jackalope yeti);
myeyesmyeyesthegogglesdoNOTHING
When I posted my code, I said that I wrote it that way to avoid using
"the dreaded soft reference". But using a soft reference is far
Bryan R Harris wrote:
>
>>On 4/1/06, Bryan Harris <[EMAIL PROTECTED]> wrote:
>>snip
>>
>>>This looks very interesting... I downloaded it, but I have no idea how to
>>>install it, though. I'm a modules-idiot. I tried putting the .pm file in
>>>the current directory and putting "use TimeTick.pm;"
On Tue, 2006-04-04 at 13:07 +1000, James Turnbull wrote:
> Mr. Shawn H. Corey wrote:
> > First question: are you running under M$ Windows or UNIX?
> >
> Unix - Linux or BSD generally
> > Second question: does this periodic function relying on data of the main
> > process?
> >
> Yes - it uses
Hello,
Just create a daemon and then put an infinite loop.
Call the subroutines with a sleep set accordingly, so
that the subroutine will run only at specified
interval.
Below is an sample code you can use.
Program will run as a daemon and you can kill it using
kill -9
Regards
Nishanth
#!/us
thanks
this solved my problem
my @output_sorted = sort { (split /,/, $b)[0] <=> (split /,/, $a)[0] }
@output;
thanks to all that helped
Jeff Pang <[EMAIL PROTECTED]> writes:
>
>>this is my friend's script
>>
>># collect all score
>> my @output = ();
>> my @old_output = ();
>> for
Hi!
I have some function, such as:
===
sub func1 {
my (%rez);
$rez{one} = 'one';
$rez{two} = 'two';
$rez{seven} = 'seven';
return %rez;
}
===
and I have such piece of code:
>===
>sub func1 {
>my (%rez);
>
>$rez{one} = 'one';
>$rez{two} = 'two';
>$rez{seven} = 'seven';
>
>return %rez;
>}
>===
>
>and I have such piece of code:
>
>===
>
38 matches
Mail list logo