Re: Variable-sized hash of booleans

2005-02-04 Thread John W. Krahn
Larsen, Errin M HMMA/IT wrote: Hi everyone, As always, we'll start with some necessary code: #!/usr/bin/perl use warnings; use strict; use Data::Dumper; Let's say I have a hash, but I don't know at compile time how many keys it has in it: my %things; die "You have

unknown parameter type

2005-02-04 Thread Giangaetano Vituzzi
Hi group, I can't seem to find a way to get this chunk of code working. I've been hacking a Perl script which is meant to catch the audio data from a microphone. I need a bit of help with Win32::API and winmm.dll as well. #!/perl use strict; use Win32::API; Win32::API->Import(winmm => q{

RE: A way to use map?

2005-02-04 Thread Bob Showalter
Kent, Mr. John (Contractor) wrote: > Greetings, > > Trying to be "cool" and apply map to the following lines of code > (which work fine as shown) > > @TIMES is an array of lines that look like > Time: Thu Feb 3 15:10:39.290 GMT 2005 End: Default.2.def-edtp0.on > Time: user 0.29 sec Delta: Defau

A way to use map?

2005-02-04 Thread Kent, Mr. John \(Contractor\)
Greetings, Trying to be "cool" and apply map to the following lines of code (which work fine as shown) @TIMES is an array of lines that look like Time: Thu Feb 3 15:10:39.290 GMT 2005 End: Default.2.def-edtp0.on Time: user 0.29 sec Delta: Default.2.def-edtp0.on Time: Thu Feb 3 15:10:43 GMT 2

Parsing C/C++ function prototypes

2005-02-04 Thread Tommy Nordgren
I wonder wether someone knows of code to parse C/C++ function prototypes into return type, function name, and a list of (type, parameter name) pairs.? Thankful for any tip. Also, have anyone tried to Use the Tk Widget set from within a perl script run from XCode? "Home is not where you are born

Re: Modifying directory permission

2005-02-04 Thread Wiggins d'Anconia
Jenda Krynicky wrote: From: "Anish Kumar K." <[EMAIL PROTECTED]> Is there any way in perl I can modify the permission of a directory using perl scripts It never ceases to amaze me how often people forget to specify their operating system when asking apparently OS specific questions ... Jenda It

RE: Variable-sized hash of booleans

2005-02-04 Thread Larsen, Errin M HMMA/IT
> -Original Message- > From: Chris Charley [mailto:[EMAIL PROTECTED] > Sent: Friday, February 04, 2005 10:45 AM > To: beginners@perl.org > Subject: Re: Variable-sized hash of booleans > > > > You can use grep. > > > > my %hash = (ONE => 1, TWO => 0, THREE => 1); > > > > if (grep {! $hash

RE: Variable-sized hash of booleans

2005-02-04 Thread Larsen, Errin M HMMA/IT
> -Original Message- > From: Chris Charley [mailto:[EMAIL PROTECTED] > Sent: Friday, February 04, 2005 10:21 AM > To: beginners@perl.org > Subject: Re: Variable-sized hash of booleans > > > You can use grep. > > my %hash = (ONE => 1, TWO => 0, THREE => 1); > > if (grep {! $hash{$_}} ke

Re: Processing unambiguous abbreviations

2005-02-04 Thread Jay
On Fri, 04 Feb 2005 07:31:09 -0800 (PST), Peter Scott <[EMAIL PROTECTED]> wrote: > >I've looked into Text::Abbrev, but there is no way to distigush > >between strings that fail to match and strings that match amiguously. > > But Text::Abbrev will form a list containing *only* strings that > are u

Re: Variable-sized hash of booleans

2005-02-04 Thread Chris Charley
You can use grep. my %hash = (ONE => 1, TWO => 0, THREE => 1); if (grep {! $hash{$_}} keys %hash) { print "false\n"; } else { print "true\n"; } Prints 'false'. Guess it would be helpful to explain how grep works here. From the perlfunc man page: Evaluates the BLOCK or EXPR for each element of LIST

Re: Variable-sized hash of booleans

2005-02-04 Thread Chris Charley
You can use grep. my %hash = (ONE => 1, TWO => 0, THREE => 1); if (grep {! $hash{$_}} keys %hash) { print "false\n"; } else { print "true\n"; } Prints 'false'. Chris -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Variable-sized hash of booleans

2005-02-04 Thread Larsen, Errin M HMMA/IT
Hi everyone, As always, we'll start with some necessary code: #!/usr/bin/perl use warnings; use strict; use Data::Dumper; Let's say I have a hash, but I don't know at compile time how many keys it has in it: my %things; die "You have an odd number of arguments.\

Re: Processing unambiguous abbreviations

2005-02-04 Thread Peter Scott
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Jay) writes: >I have the following code snippet, designed to let my script accept >the ubiquitous "unambiguous abbreviations" in a configuration file. >The ultimate goal, for those who are interested, is to take the >abbreviated entries and gener

Re: Deleting selected files in a directory through perl

2005-02-04 Thread Ing. Branislav Gerzo
Jenda Krynicky [JK], on Friday, February 04, 2005 at 13:58 (+0100) wrote these comments: JK> Don't shell out (start external programs) for things you may do in JK> Perl easily: JK> Eg. JK> my @files = do {open my $IN, '<', 'filelist.txt'; <$IN>}; for 'test' purposes is shorter my @files

Re: Deleting selected files in a directory through perl

2005-02-04 Thread Jenda Krynicky
From: "Ing. Branislav Gerzo" <[EMAIL PROTECTED]> > Kamalraj Singh Madhan, Noida [KSM], on Friday, February 4, 2005 at > 13:38 (+0530 ) typed: > > KSM> Kindly let me know if this possible, deleting some selected > files from a KSM> directory through a perl script. This selection > would be ba

RE: configuration steps for perl with apache to support cgi-file

2005-02-04 Thread Manav Mathur
httpd.conf == - Hope you Servername dorective is already correct - Add(or uncomment) ScriptAlias /cgi-bin/ "/path/to/Apache/cgi-bin/" - Add(or uncomment) AllowOverride None Options ExecCGI -Original Message- From: vishwas bhakit [mailto:[EMAIL PROTECTED] Sent: Friday,

configuration steps for perl with apache to support cgi-file

2005-02-04 Thread vishwas bhakit
hello i need to do following. Will anybody help me configuration steps for perl with apache to support cgi-file thnx in advance Yahoo! India Matrimony: Find your life partneronline.

configuration steps for perl with apache to support cgi-file

2005-02-04 Thread vishwas bhakit
hello i need to do following. Will anybody help me configuration steps for perl with apache to support cgi-file thnx in advance Yahoo! India Matrimony: Find your life partneronline.

RE: Deleting selected files in a directory through perl

2005-02-04 Thread Manav Mathur
my @files= ; ##should be good enough -Original Message- From: Ing. Branislav Gerzo [mailto:[EMAIL PROTECTED] Sent: Friday, February 04, 2005 1:57 PM To: beginners@perl.org Subject: Re: Deleting selected files in a directory through perl Kamalraj Singh Madhan, Noida [KSM], on Friday, F

Re: Deleting selected files in a directory through perl

2005-02-04 Thread Alfred Vahau
Hi, use the File::Find module and its methods. An example of usage may be found at this URL. http://www.perl.com/pub/a/2004/10/14/file_editing.html You can modify the last example to delete recursively. alfred, Kamalraj Singh Madhan, Noida wrote: Hi All, Kindly let me know if this possible, de

Re: Deleting selected files in a directory through perl

2005-02-04 Thread Ing. Branislav Gerzo
Kamalraj Singh Madhan, Noida [KSM], on Friday, February 4, 2005 at 13:38 (+0530 ) typed: KSM> Kindly let me know if this possible, deleting some selected files from a KSM> directory through a perl script. This selection would be based on the KSM> filename existing in a particular text file,

Deleting selected files in a directory through perl

2005-02-04 Thread Kamalraj Singh Madhan, Noida
Hi All, Kindly let me know if this possible, deleting some selected files from a directory through a perl script. This selection would be based on the filename existing in a particular text file, if it exists then delete from directory otherwise not since I do not want to delete all of the file

Re: replacing special chars

2005-02-04 Thread John
- Original Message - From: "Stout, Joel R" <[EMAIL PROTECTED]> To: "John" <[EMAIL PROTECTED]>; "Perl Beginners" Sent: Thursday, February 03, 2005 8:17 PM Subject: RE: replacing special chars > Try this, and remember - with XML there are more than one you have to > change: > > sub xc {