Number is say XY then u can write it as 10X+Y.
Now you are doing 10X+Y - (10Y+X)
which is 9(X-Y) where X and Y lie between 0 and 9 . when X >Y you get multiples of 9
in increasing order and when X
Pass the keys($dom,$eng...) by ref. All you are doing is passing the array by
reference which has a copy of your keys.
-
Get a bigger mailbox -- choose a size that fits your needs.
Wiggins D'Anconia wrote at Thu, 05 Sep 2002 02:58:45 +0200:
> ...
> Question 1: Is there a way to differentiate the return context between
> "array context" and "hash context" from what I have seen there is just
> one big "list context"??
> ...
> ...
You might also have a look to the CPAN mod
On Linux , open /etc/smb.conf and set the attributes
there. It is basically for setting the attributes for
printers etc. But every thing is file on linux so you
can do it.
__
Do You Yahoo!?
Everything you'll ever need on one web page
from News and
On Tue, Sep 04, 2001 at 07:20:27PM +0200, Quincy Ntuli wrote:
>
> greetings
>
> I am trying to return the value from an associate array; i do not understand what i
>am doing wrong.
>
...code that others already commented on snipped...
> $theHash{'$sortedListing[1]'} =[$dbRec];
You h
Zanardi2k2 wrote:
> Now, my question:
> - if i want to run my scripts on different machines over the network
> (Windows), should i install a Perl interpreter on each machine or can
> i point to a network perl executable without troubles?
>
> TIA
>
An add-on: i *tried* running perl from a netw
James Edward Gray II wrote:
> If you have fixed width values, separated by spaces and with no spaces
> in the values, you could use the super simple:
>
> @list_of_values = split ' ', $fixed_width_line;
No, unfortunately i do have spaces in values. Felix suggestion seems the
right way to do it
Hi
Thanks alot for your help, i finally got my word inserted just once in
every file (was re ALIGNMENTS..)
yea...am kinda slooow! :)
nandita
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Ok
Thank you,
Steve Maroney
On Wed, 4 Sep 2002, tang karen wrote:
> Dear Sir and Madam.
>
> Please don't send me any mail.
> Thank your!
>
>
>
>
> _
> Join the worlds largest e-mail service with MSN Hotmail.
> http://www.hotmail.c
Hi, I'm pretty new to perl. I want to open a Directory with mp3 files an
other files. My Poblem is i need only the mp3 files. How can i get only
the mp3 files and not other files ?
I tried:
while (defined(my $file=readdir(DIR))) {
next if $file=~ /^\.\.?$/;
next unless /\.[mp3]
Hi,
The answer is in your question.
Cheers
- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, September 04, 2002 1:49 PM
Subject: Re: converting a list into array
> The script gave a syntax error at
>
> chomp(my @data = );
>
> However, when I tri
ie - i have two arrays (lists):
@hrefs: a list of urls..
and @banned, and list of bad urls. I want to remove
the @banned urls from @hrefs.
How would i do this?
__
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com
Felix Geerinckx wrote:
> (...)
> Or, by using push, you take the next available position:
>
> push @array, 3;
>
> is the same as
> $array[2] = 2;
> (...)
Maybe a typo?
push @array, 3;
should be the same as
$array[2] = 3;
--
Zanardi2k2
--
To unsubscribe, e-m
On Wed, Sep 04, 2002 at 09:41:54PM +0200, Fabian Funk wrote:
> Hi, I'm pretty new to perl. I want to open a Directory with mp3 files an
> other files. My Poblem is i need only the mp3 files. How can i get only
> the mp3 files and not other files ?
>
> I tried:
>
> while (defined(my $file=readd
Fabian Funk wrote at Wed, 04 Sep 2002 21:41:54 +0200:
> Hi, I'm pretty new to perl. I want to open a Directory with mp3 files an
> other files. My Poblem is i need only the mp3 files. How can i get only
> the mp3 files and not other files ?
>
> I tried:
>
> while (defined(my $file=readdir(DIR
Why not:
my $spec = "/var/www/*.mp3";
my ( @files ) = glob $spec;
print "Checked '$spec' - found ", scalar(@files), " files:\n ",
join("\n ", @files ), "\n";
regards
Jeff
> -Original Message-
> From: Fabian Funk [mailto:[EMAIL PROTECTED]]
> Sent: 04 September 2002 20:4
On Wed, 4 Sep 2002, Anthony E. wrote:
> ie - i have two arrays (lists):
>
> @hrefs: a list of urls..
> and @banned, and list of bad urls. I want to remove
> the @banned urls from @hrefs.
This is a faq, perldoc -q intersection
>
> How would i do this?
>
>
> __
opendir DIR,
while (defined(my $file=readdir(DIR))) {
next unless $file=~/\.mp3$/i ;
push(@files,$file);
}
works for me.
Omanakuttan N,
C,C++,Networking, perl, Linux
Tata Elxsi Ltd,
ph.8410 222 x 414.
---
' ...follow me' ,
Forgot to forward to the list, sorry again
-- Forwarded message --
Date: Fri, 6 Sep 2002 15:19:58 +0530 (IST)
From: Sudarshan Raghavan <[EMAIL PROTECTED]>
To: Fabian Funk <[EMAIL PROTECTED]>
Subject: Re: Reading Directory
On Wed, 4 Sep 2002, Fabian Funk wrote:
> Hi, I'm pretty
I have used Perl for a while, and always used dumpvar.pl /
main::dumpvalue() to dump out things (I guess that tells you how long!
8-))
I had a look at Data::Dumper - but its dumps are either too terse (i.e.
all one line) or too verbose (i.e. I am dumping data structures and
don't really need to w
could you please mail an example so that your query
become clearer.
do you have any criteria for distinguishing between
the bad and good ones. if yes, then use that to get
the "bad elements" from href .
well your example can make the question clearer.
NAME
beginners-faq - FAQ for the beginners mailing list
1 - Administriva
1.1 - I'm not subscribed - how do I subscribe?
Send mail to <[EMAIL PROTECTED]>
You can also specify your subscription email address by sending email to
(assuming [EMAIL PROTECTED] is your email address)
on Thu, 05 Sep 2002 08:46:08 GMT, [EMAIL PROTECTED]
(Zanardi2k2) wrote:
> Felix Geerinckx wrote:
>
>> push @array, 3;
>>
>> is the same as
>> $array[2] = 2;
>> (...)
>
>
> Maybe a typo?
>
> push @array, 3;
>
> should be the same as
>
> $array[2] = 3;
Indeed.
Thanks to everyone for there help. I manage to get it to work for what I
need it for. Now onto other stuff.
:-)
> --
> From: Tim Musson[SMTP:[EMAIL PROTECTED]]
> Reply To: Tim Musson
> Sent: Wednesday, September 04, 2002 8:46 PM
> To: [EMAIL PROTECTED]
> Subject:
How do I detect whether a module is installed or not?
For example, if a script is running as root, this would be useful:
if (Tk is not installed ) { # This is what I need.
print "Do you want to install the Tk perl module? (y/n) [n] >> ";
my $answer=;
exit if ($answer!~/^[Yy]/);
print "You
Hello All
I think my question is slightly misplaced in this newsgroup
I have been using DB_File.pm to read Berkely db files
Is there a similar library for C ( not C++ )
I have been trying google search but could get one
Thanks
Ram
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For addit
All,
I am experiencing the most bizarre problem with my perl script. I am
running the below script on windows nt, that may be the root of the
problem.. The script reads a file and checks to see it the words "Sleeping
for 10 seconds" appears. If it appears four times in a row it sends a text
mes
I think I may have answered my own question.
Is there a "better way" (TM) or a more efficient way?
eval { require Tk };
if ($@) { # module is NOT installed
# code here to make sure user is root and wants to proceed
system('perl -MCPAN -e \'CPAN::Shell->install("Tk")\'');
}
use Tk;
etc. etc.
I think I'm going in circles. Sorry about the multiple postings.
The program barfs on 'use Tk' even though by the time I get to the 'use
Tk' the Tk module should be installed.
I tried doing require Tk; import Tk;
but then I get this message:
Bareword "MainLoop" not allowed while "strict subs" in
On Wednesday, Sep 4, 2002, at 12:30 US/Pacific, Jason Frisvold wrote:
[..]
>
> Any idea on how to do this? Thoughts? Suggestions? Code!?
>
> ---
> Jason H. Frisvold
first off, I totally agree with phi - there is no quick
and easy solution... but some experience I have
On Thursday, Sep 5, 2002, at 07:32 US/Pacific, Ramprasad A Padmanabhan
wrote:
> Hello All
>I think my question is slightly misplaced in this newsgroup
> I have been using DB_File.pm to read Berkely db files
> Is there a similar library for C ( not C++ )
>
>I have been trying google sear
sounds like you want to remove all @banned from @hrefs right?
if your arrays are small and you don't care using up a little memeory:
my @hrefs = (1..10);
my @banned = (3..6);
my %hash;
@hash{@a} = ();
delete @hash{@b}; #-- remove 3,4,5,6 from 1 to 10
foreach my $i (keys %hash){
print "
On Sep 5, Pete Emerson said:
>I think I'm going in circles. Sorry about the multiple postings.
>The program barfs on 'use Tk' even though by the time I get to the 'use
>Tk' the Tk module should be installed.
'use Tk' happens at compile-time. The trick is to make the test happen at
compile-time
Hello,
I am having issues with writing standardout to disk. ( in chunks) I
have a small backup script that runs. It uses Net::SSH::Perl to send a
tar command to the hoem directory of a server. The tar command pipes
eveything to STDOUT, on the backend I write that STDOUT to disk.
Everything
Guys I am still struggling with this.
If anyone can help me I would greatly appreciate it.
I am trying to call the Crypt::Cracklib Module in my perl script.
The error log on my server keeps giving me this:
Can't locate loadable object for module Crypt::Cracklib in @INC --> Can anyone help me
If I put a lot of subroutines in the BEGIN { } section, so that they
load at compile-time, what is the disadvantage?
BEGIN {
eval { require Tk; };
if ($@) {
# Do the NoGUI stuff here
exit;
}
sub LotsOfSharedSubsHere { }
}
use Tk;
print "GUI section.\n";
Lo
Pete Emerson wrote:
> I think I'm going in circles. Sorry about the multiple postings.
> The program barfs on 'use Tk' even though by the time I get to the 'use
> Tk' the Tk module should be installed.
> I tried doing require Tk; import Tk;
> but then I get this message:
> Bareword "MainLoop" not
> -Original Message-
> From: david [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, September 05, 2002 1:07 PM
> To: [EMAIL PROTECTED]
> Subject: Re: getting an intersection between two arrays
>
>
> sounds like you want to remove all @banned from @hrefs right?
> if your arrays are small
that doesn't really work. if you have a large list and don't want to spell
out each individual elements, try generating the format list yourself and
then just eval it in run time like:
#!/usr/bin/perl -w
use strict;
my @a = (1..5);
my $eval = <<'START';
format FM =
=
a
Lance Prais wrote:
>
> I am experiencing the most bizarre problem with my perl script. I am
> running the below script on windows nt, that may be the root of the
> problem.. The script reads a file and checks to see it the words "Sleeping
> for 10 seconds" appears. If it appears four times in a
Let me ask this then. If I wanted to work around the fluctuations, could I
just search for a string in the doc rather the going to a position and only
looking there?
If so does anyone know of documentation on the web that would help me with
this?
Thanks
Lance
-Original Message-
From: J
Yes, I agree that it very hard to read, and next to impossible to debug. I
appreciate everyone's comments very much. I will use your troubleshooting
method, but the kicker is the the damned backup program write these random
log file names (thus the my @files = glob('3*.log');), so I could only thi
In article <001501c254d3$2666a910$3864a8c0@comice>,
[EMAIL PROTECTED] (Jeff Aa) writes:
>I have used Perl for a while, and always used dumpvar.pl /
Plze don't. AFAIK the only thing in the core that uses it is the
debugger. I would so love to deprecate it. You think it's hard to
use, you s
How do I start a program in perl and send keystrokes to it??
thanks
This electronic message may contain confidential or privileged information
and is intended for the individual or entity named above. If you are
not the intended recipient, be aware that any disclosure, copying,
distributio
If my constructor takes four arguments, ala:
my ($instanceName, $instanceHost, $instanceUser, $instancePass) = @_;
What's an eloquent way of looping through those four and setting their
value to "" if there are no arguments passed?
-=[ Elliot @ pixeltree.org ]=-
--
To unsubscribe, e-mail:
On Sep 5, Elliot Tobin said:
>If my constructor takes four arguments, ala:
>
>my ($instanceName, $instanceHost, $instanceUser, $instancePass) = @_;
>
>What's an eloquent way of looping through those four and setting their
>value to "" if there are no arguments passed?
Well, I take it you mean yo
If you're using a Win32 platform, I'd look for Win32::SetupSup.
-Original Message-
From: Tyler, Grayling [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 05, 2002 10:44 AM
To: [EMAIL PROTECTED]
Subject: how do send keys
How do I start a program in perl and send keystrokes to it??
John W. Krahn wrote:
>>however I am unclear what the following is (or how
>>Perl determines it, though this is less important for now if it will
>>make my head hurt),
>>
>>if ( &call_sub_like_this ) {
>>do something cool here
>>}
>>
>>Is this void because I am not assigning the valu
Code sample:
safe to assume @vals and @heads are predefined and contain equal # of
values, use strict and use warnings are in place.
if (wantarray) {
return @vals;
}
else {
# create hash where keys are from @heads and values are from @vals
# then return a reference to that hash, onl
Was your perl loaded from rpm?
Can you tell us what paths are in @INC?
Where is the "Crypt/Cracklib.pm" file?
As far as loading other modules, let CPAN be your friend. For instance
at the command line, invoke the CPAN shell with
root> perl -MCPAN -e shell
(configure CPAN, most questions are
I'm writing a script that is currently interactive ( once I'm done debugging
it will be non-interactive) in that I have to tell it to keep processing
data after the end of every pass. I'm looking for a way to display the
script's output on my screen, but also to log it to a file if possible. I
kno
I have just started using perl and I have been asked to write a script
that will open a perl script, count all of the variables identified by
$... and print to the screen the number of unique variables and display
a list of variables used. Can anyone tell me where to start?
--
To unsubscribe
You could open a file from within the script, then for each of your
prints, print both to the open filehandle and also to standard out.
This should work though I would imagine (hope) there is a better way.
http://danconia.org
Troy May wrote:
> I'm writing a script that is currently interactive
I think I found it! Read this:
|tee - Tee allows for the stdout to be sent to both the screen and to a file
"command |tee outfile"
Does this make sense?
-Original Message-
From: Wiggins d'Anconia [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 05, 2002 7:06 PM
To: Troy May
Cc:
On Sep 5, Wiggins d'Anconia said:
>my %vals;
>@vals{@heads} = @vals;
>return \%vals;
That's about as concise as you can get it.
>I was surprised that I could not avoid in the else doing the code in 3
>lines (obviously this isn't a huge deal).
>
>I was looking for something like:
>
>
On Thu, Sep 05, 2002 at 07:16:45PM -0400, Wiggins d'Anconia wrote:
> if ( 1 > my_sub_that_returns ) {
> # do something cool.
> }
> It seems like this case could go either way, that is, in some cases your
> function could simply be returning a scalar value, say 0 for a failure
> in the
Drieux wrote:
>
> On Thursday, Sep 5, 2002, at 07:32 US/Pacific, Ramprasad A Padmanabhan
> wrote:
>
>> Hello All
>>I think my question is slightly misplaced in this newsgroup
>> I have been using DB_File.pm to read Berkely db files
>> Is there a similar library for C ( not C++ )
>>
>>I
Mike Singleton wrote:
>
> Yes, I agree that it very hard to read, and next to impossible to debug. I
> appreciate everyone's comments very much. I will use your troubleshooting
> method, but the kicker is the the damned backup program write these random
> log file names (thus the my @files = glob
Grayling Tyler wrote:
>
> How do I start a program in perl and send keystrokes to it??
perldoc -f open
perldoc perlopentut
perldoc Expect
perldoc IPC::Open2
perldoc IPC::Open3
John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail
On 5 Sep 2002, Chuck Belcher wrote:
> I have just started using perl and I have been asked to write a script
> that will open a perl script, count all of the variables identified by
> $... and print to the screen the number of unique variables and display
> a list of variables used. Can anyone t
Hi
Read Perl regular expressions.
Dharmender Rai
__
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional comm
Is there anybody that can help me ?
Thank you very much!
>
> When I use following option of the TK::Tree:
> --
> Name: browseCmd
> Class: BrowseCmd
> Switch: -browsecmd
> Specifies a callback to call whenever the user browses on an entry (usually by
>si
Wiggins D'Anconia wrote:
>
> Code sample:
>
> safe to assume @vals and @heads are predefined and contain equal # of
> values, use strict and use warnings are in place.
>
> if (wantarray) {
> return @vals;
> }
> else {
> # create hash where keys are from @heads and values are from @vals
Troy May wrote:
> I'm writing a script that is currently interactive ( once I'm done debugging
> it will be non-interactive) in that I have to tell it to keep processing
> data after the end of every pass. I'm looking for a way to display the
> script's output on my screen, but also to log it to a
If you want to do the same thing without relying on an external program, you
can just create a Tee function:
Tee("This should print to the screen and a file.\n");
sub Tee{
open(OUTFILE,">myfile.txt");
print @_;
print OUTFILE @_;
close OUTFILE;
}
-Original Message-
From: Troy Ma
65 matches
Mail list logo