RE: play sounds

2008-07-02 Thread Thomas Bätzler
Jennifer G. <[EMAIL PROTECTED]> asked: > How to make a perl program under windows to play sounds? > thanks. http://search.cpan.org/~jdb/Win32-Sound-0.49/ HTH, Thomas -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: removing '*' from *****STAFF*****

2008-07-02 Thread John W. Krahn
Manasi Bopardikar wrote: Does anyone know how do I remove the beginning and the trailing * from *STAFF* my $stuff = '*STAFF*'; s/^\*+//, s/\*+$// for $stuff; Or if you want to remove all * regardless of where in the string they are located: $stuff =~ tr/*//d; John -- Pe

Re: Max range of rand function?

2008-07-02 Thread John W. Krahn
howa wrote: On 7$B7n(B2$BF|(B, $B2<8a(B11$B;~(B59$BJ,(B, [EMAIL PROTECTED] (John W. Krahn) wrote: howa wrote: Hi, Hello, I want to have a max range of rand function, so I use my $rnd = rand(4294967295) ; However, is it safe to use so, e.g. in 32 bit system? rand() returns a float

Re: removing '*' from *****STAFF*****

2008-07-02 Thread Enigma
Enigma wrote: Manasi Bopardikar wrote: Does anyone know how do I remove the beginning and the trailing * from *STAFF* Thanks and Regards, Manasi Bopardikar|s/w Engineer|Persistent SystemsLtd (+91)(020)(30234497)|9767218759 [EMAIL PROTECTED] DISCLAIMER == This e-mai

Re: removing '*' from *****STAFF*****

2008-07-02 Thread Enigma
Manasi Bopardikar wrote: Does anyone know how do I remove the beginning and the trailing * from *STAFF* Thanks and Regards, Manasi Bopardikar|s/w Engineer|Persistent SystemsLtd (+91)(020)(30234497)|9767218759 [EMAIL PROTECTED] DISCLAIMER == This e-mail may contain p

removing '*' from *****STAFF*****

2008-07-02 Thread Manasi Bopardikar
Does anyone know how do I remove the beginning and the trailing * from *STAFF* Thanks and Regards, Manasi Bopardikar|s/w Engineer|Persistent SystemsLtd (+91)(020)(30234497)|9767218759 [EMAIL PROTECTED] DISCLAIMER == This e-mail may contain privileged and confidential in

Re: some question about komodo4

2008-07-02 Thread wise
On Jul 1, 6:37 pm, [EMAIL PROTECTED] (Tobias Eichner) wrote: > > thanks for you help, but can you tell me how to set it? > > could you tell me the detail process? > > Go to the software preferences: At the left panel select "Code Intelligence" > and check the settings there (ensure that auto-compl

Re: play sounds

2008-07-02 Thread Robert Blackwell
Jennifer G. wrote: Hi, How to make a perl program under windows to play sounds? thanks. Could you give a bit more information? Do you all ready have some sound files .wav, .mp3 etc that you want to play? Or are you wanting to some how compose music with perl doing something with MIDI? Do

play sounds

2008-07-02 Thread Jennifer G.
Hi, How to make a perl program under windows to play sounds? thanks. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: kill process when file number reached...

2008-07-02 Thread onlineviewer
On Jul 1, 9:02 pm, [EMAIL PROTECTED] (Jenda Krynicky) wrote: > To: [EMAIL PROTECTED] > From: onlineviewer <[EMAIL PROTECTED]> > Subject:kill process when file number reached... > Date sent: Tue, 1 Jul 2008 11:26:42 -0700 (PDT) > Org

Re: user id validation

2008-07-02 Thread Randal L. Schwartz
$< is a uid getpwuid($<) looks up the info on that. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <[EMAIL PROTECTED]> http://www.stonehenge.com/merlyn/> Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc. See http://methodsandmessages.vox.com/ f

Re: user id validation

2008-07-02 Thread Richard Lee
Rajnikant wrote: Hey Richard, I think $< returns user id. Correct me if I'm wrong ;-). yes, you are correct. I was reading the perldoc .. on this and I was bit confused at first, on $uid = getpwnam ($name); $name = getpwuid

Re: @INC and cross-platform path usage

2008-07-02 Thread Tobias Eichner
@Gunnar Hjalmarsson: > To me it seems as there is no perfect method. As long as you invoke your > program from command line, perhaps FindBin is the best choice. But since > you are going to write CGI programs, FindBin's failure as regards > mod_perl is not insignificant. Therefore I'd stick with

Re: substitution

2008-07-02 Thread Dr.Ruud
epanda schreef: > I want to replace my pattern by the corresponding value of the key > in the hash table [...] > with a single %s/pattern/hashpattern/g expression Why that last condition? Sounds like homework. And is unsound: often you want to do the longest possible change first. -- Affijn, R

Re: @INC and cross-platform path usage

2008-07-02 Thread Jay Savage
On Tue, Jul 1, 2008 at 11:30 AM, Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote: > Thomas Bätzler wrote: >> >> Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote: >>> >>> Some would suggest the use of the FindBin module. It does the right >>> thing, but unfortunately it is known to be buggy. >> >> Actually

Re: Max range of rand function?

2008-07-02 Thread Rob Dixon
John W. Krahn wrote: > howa wrote: >> >> I want to have a max range of rand function, so I use >> >> my $rnd = rand(4294967295) ; >> >> However, is it safe to use so, e.g. in 32 bit system? > > rand() returns a floating point number that is based on RANDBITS and not > the size of the CPU register

Re: simplify a path

2008-07-02 Thread Rob Dixon
John W. Krahn wrote: > John W. Krahn wrote: >> Chen Yue wrote: >> >>> I have a file containing UNIX-styled Path in each line. But the path is >>> simplified enough. Some of them has ".." and "." in the middle, such as >>> "/a/b/./c/../d". Now I want to simplify each Path according to Unix >>> trad

Re: simplify a path

2008-07-02 Thread John W. Krahn
John W. Krahn wrote: Chen Yue wrote: I have a file containing UNIX-styled Path in each line. But the path is simplified enough. Some of them has ".." and "." in the middle, such as "/a/b/./c/../d". Now I want to simplify each Path according to Unix tradition. /a/b/./c/../d->/a/b/d T

Re: simplify a path

2008-07-02 Thread John W. Krahn
Chen Yue wrote: Hi Hello, I have a file containing UNIX-styled Path in each line. But the path is simplified enough. Some of them has ".." and "." in the middle, such as "/a/b/./c/../d". Now I want to simplify each Path according to Unix tradition. /a/b/./c/../d->/a/b/d The only w

Re: Max range of rand function?

2008-07-02 Thread John W. Krahn
howa wrote: Hi, Hello, I want to have a max range of rand function, so I use my $rnd = rand(4294967295) ; However, is it safe to use so, e.g. in 32 bit system? rand() returns a floating point number that is based on RANDBITS and not the size of the CPU registers, so to see how many bits

Re: simplify a path

2008-07-02 Thread Rob Dixon
Chen Yue wrote: > > Rob Dixon wrote: >> >> Chen Yue wrote: >>> >>> I have a file containing UNIX-styled Path in each line. But the path is >>> simplified enough. Some of them has ".." and "." in the middle, such as >>> "/a/b/./c/../d". >>> Now I want to simplify each Path according to Unix traditi

Max range of rand function?

2008-07-02 Thread howa
Hi, I want to have a max range of rand function, so I use my $rnd = rand(4294967295) ; However, is it safe to use so, e.g. in 32 bit system? Thanks. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: @INC and cross-platform path usage

2008-07-02 Thread Gunnar Hjalmarsson
Tobias Eichner wrote: Giving it a closer look, I experience a strange behaviour. I'm using ActiveState Perl on WinXp here. The following script has been used for testing: use File::Spec; BEGIN { my ($volume,$softwaredir,$librarydir); ($volume,$softwaredir) = File::Spec->splitpath(

Re: regexp behin assertions ?

2008-07-02 Thread obdulio santana
Hi Where is a solution(s) of this thread? It's a litle bit weird ask for help, and don't offer a "posible solution". At least with a study case would be enough, don't mentioning further details. cheers -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTEC

Re: about perl module uninstallation

2008-07-02 Thread Telemachus
On Jul 1, 12:22 pm, [EMAIL PROTECTED] (Randal L. Schwartz) wrote: > I tried not to have to explain all this in my previous post, but since > you challenged my brief explanation, here's the details, yet again. Please, > just trust me when I say things in the future. It's faster. :) For fun, I wil

Re: Array problem

2008-07-02 Thread Beyza
Thanks for the answers. I have tried to use quotemeta but it did not work as expected, DBI's quote function was exactly what I want. Thanks again, On Jul 1, 6:35 pm, [EMAIL PROTECTED] (Amit Saxena) wrote: > use > > $*dbh*->*quote*($str) > > On Tue, Jul 1, 2008 at 4:59 AM, Gunnar Hjalmarsson <[EM

Re: simplify a path

2008-07-02 Thread Amit Saxena
Hi I agree that the code has some flaws in that. Infact immediately after posting my solution, I thought of your test case only. If I will get some time, I will work on the same and let you know. Thanks for the feedback. Regards, Amit Saxena On Wed, Jul 2, 2008 at 8:08 PM, Chen Yue <[EMAIL PR

RE: simplify a path

2008-07-02 Thread Chen Yue
Hi Amit The code really works but with a tiny flaw. If the path is "/a/b/../../c", the result would be "/a/../c" rather than "/c". So I need to loop to clean up the dot-dot if tied up Thank you for the suggestion Hi The code would be something like this :- [root@ ~]# cat t.p

Re: regexp behin assertions ?

2008-07-02 Thread epanda
I can't it is confidential and I have found. Thanks a lot On 2 juil, 00:46, [EMAIL PROTECTED] (Gunnar Hjalmarsson) wrote: > epanda wrote: > > Gunnar Hjalmarsson wrote: > >> [ Please do not top-post! ] > > > > >> Maybe I'm dumb, but it's not clear to me what you want to achieve. It > >> might be

RE: simplify a path

2008-07-02 Thread Chen Yue
Hi Peter Actually, I don't want to translate the path into realpath because some of the paths even do not exist on the host. What I need is just a simplified format. Anyway, thank you for the advice. On Wed, 02 Jul 2008 21:33:59 +0800, Chen Yue wrote: > I have a file containing UNIX-styled Path

RE: simplify a path

2008-07-02 Thread Chen Yue
Hi Rob Thank you for the suggestion. Actually, abs_path requires the original path exists on the host. But my case does not fulfill this. This is what puzzled me. Sent: Wednesday, July 02, 2008 9:58 PM To: beginners@perl.org Cc: Chen Yue Subject: Re: simplify a path Chen Yue wrote: > > I have

Re: simplify a path

2008-07-02 Thread Peter Scott
On Wed, 02 Jul 2008 21:33:59 +0800, Chen Yue wrote: > I have a file containing UNIX-styled Path in each line. But the path is > simplified enough. Some of them has ".." and "." in the middle, such as > "/a/b/./c/../d". > Now I want to simplify each Path according to Unix tradition. > > /a/b/./c/.

Re: simplify a path

2008-07-02 Thread Amit Saxena
Hi The code would be something like this :- [root@ ~]# cat t.pl #!/usr/bin/perl $str = "/a/b/./c/../d"; $str1 = $str; print "\nstr = [$str]"; print "\nstr1 = [$str1]"; print "\n---"; $str1 =~ s/([^\/]+)\/\.\.\/([^\/]+)/$2/g; print "\nstr = [$st

Re: simplify a path

2008-07-02 Thread Rob Dixon
Chen Yue wrote: > > I have a file containing UNIX-styled Path in each line. But the path is > simplified enough. Some of them has ".." and "." in the middle, such as > "/a/b/./c/../d". > Now I want to simplify each Path according to Unix tradition. > > /a/b/./c/../d->/a/b/d > > The only

Re: simplify a path

2008-07-02 Thread Jeff Peng
On Wed, Jul 2, 2008 at 9:33 PM, Chen Yue <[EMAIL PROTECTED]> wrote: > Hi > > I have a file containing UNIX-styled Path in each line. But the path is > simplified enough. Some of them has ".." and "." in the middle, such as > "/a/b/./c/../d". > Now I want to simplify each Path according to Unix trad

simplify a path

2008-07-02 Thread Chen Yue
Hi I have a file containing UNIX-styled Path in each line. But the path is simplified enough. Some of them has ".." and "." in the middle, such as "/a/b/./c/../d". Now I want to simplify each Path according to Unix tradition. /a/b/./c/../d->/a/b/d The only way I could think out is to sp

Re: Perl how to die without printing out a message?

2008-07-02 Thread Rob Dixon
Ravi Malghan wrote: > Hi: I connect to a database within my script. If the script cannot connect, I > want it to send an email and terminate without printing any message on > stdout. I have the following code $dbh = > DBI->connect("dbi:Pg:dbname=$dbname;host=$host;port=$port;","$username", > "$pass

Re: AW: AW: @INC and cross-platform path usage

2008-07-02 Thread Jenda Krynicky
From: Tobias Eichner <[EMAIL PROTECTED]> > @Gunnar Hjalmarsson: > > > use File::Spec; > > my ($vol, $progdir); > > BEGIN { ($vol, $progdir) = File::Spec->splitpath( __FILE__ ) } > > use lib File::Spec->catpath( $vol, $progdir, 'libraries' ); > > At http://perldoc.perl.org/perl

Re: Re: Re: @INC and cross-platform path usage

2008-07-02 Thread Jenda Krynicky
From: "Amit Saxena" <[EMAIL PROTECTED]> > I still doubt whether > > * unshift (@INC,$librarydir);* > > works or not. > > To the best I have read the articles and tutorials, @INC can't be updated in > this way. Then you've read them wrong. Of course you can use unshift() on @INC, you just have

RE: Perl how to die without printing out a message?

2008-07-02 Thread Stewart Anderson
Send it to an error sub ? connect("dbi:Pg:dbname=$dbname;host=$host;port=$port;","$username", "$password", {AutoCommit => 1}) or &Error("error message"); sub Error { my ($errormessage) = @_ sendmail etc } HTH Stu -Original Message- Fro

Perl how to die without printing out a message?

2008-07-02 Thread Ravi Malghan
Hi: I connect to a database within my script. If the script cannot connect, I want it to send an email and terminate without printing any message on stdout. I have the following code   $dbh = DBI->connect("dbi:Pg:dbname=$dbname;host=$host;port=$port;","$username", "$password", {AutoCommit => 1}

Re: @INC and cross-platform path usage

2008-07-02 Thread Tobias Eichner
@Gunnar Hjalmarsson: > That code is executed at runtime, and hence lets you require() modules > at runtime. If you want to use() a module instead, you need to make the > code be executed at compile time. You can do that by putting the code in > a BEGIN block. Thanks for noting. I've considered

Re: @INC and cross-platform path usage

2008-07-02 Thread Gunnar Hjalmarsson
Tobias Eichner wrote: I wrote the following script that fits my needs; maybe someone finds it useful, maybe someone finds an error in it (if so, let me know - I tested it on OS X and Win XP): use File::Spec; my ($volume,$softwaredir,$librarydir); ($volume,$softwaredir) = File::Spec->splitpath

Re: @INC and cross-platform path usage

2008-07-02 Thread Gunnar Hjalmarsson
Amit Saxena wrote: I still doubt whether * unshift (@INC,$librarydir);* works or not. To the best I have read the articles and tutorials, @INC can't be updated in this way. Where did you read that? -- Gunnar Hjalmarsson Email: http://www.gunnar.cc/cgi-bin/contact.pl -- To unsubscribe, e-ma

Re: Re: Re: @INC and cross-platform path usage

2008-07-02 Thread Tobias Eichner
Giving it a closer look, I experience a strange behaviour. I'm using ActiveState Perl on WinXp here. The following script has been used for testing: use File::Spec; BEGIN { my ($volume,$softwaredir,$librarydir); ($volume,$softwaredir) = File::Spec->splitpath(__FILE__); $libraryd

Re: Re: Re: @INC and cross-platform path usage

2008-07-02 Thread Tobias Eichner
> * unshift (@INC,$librarydir);* ... > To the best I have read the articles and tutorials, @INC can't be updated in > this way. What I read about is that paths can't be deleted easily from @INC, but I haven' tried it yet (since I don't see an application deleting a path that others have set at @

Re: Re: Re: @INC and cross-platform path usage

2008-07-02 Thread Amit Saxena
Hi I still doubt whether * unshift (@INC,$librarydir);* works or not. To the best I have read the articles and tutorials, @INC can't be updated in this way. You have to either use one of the options below :- - *PERL5LIB* environment variable - using *use lib ("")* construct - use *Fi

Re: Re: Re: @INC and cross-platform path usage

2008-07-02 Thread Tobias Eichner
I wrote the following script that fits my needs; maybe someone finds it useful, maybe someone finds an error in it (if so, let me know - I tested it on OS X and Win XP): use File::Spec; my ($volume,$softwaredir,$librarydir); ($volume,$softwaredir) = File::Spec->splitpath(__FILE__); $librarydir

Re: about Zlib

2008-07-02 Thread Rob Dixon
Amit Saxena wrote: > > On Wed, Jul 2, 2008 at 12:50 PM, Rajnikant <[EMAIL PROTECTED]> wrote: >> >> From: Jeff Peng [mailto:[EMAIL PROTECTED] >>> >>> On Wed, Jul 2, 2008 at 12:43 PM, Rajnikant <[EMAIL PROTECTED]> wrote: I want to uncompress *.gz and *.tar on linux box. So is ther

Re: about Zlib

2008-07-02 Thread Rob Dixon
Rajnikant wrote: > > From: Jeff Peng [mailto:[EMAIL PROTECTED] >> >> <[EMAIL PROTECTED]> wrote: >> >>> I want to uncompress *.gz and *.tar on linux box. >>> >>> So is there any package which will do it for me? >>> Can we use Zlib to do same? >> >> Search and use a module from CPAN, that will m

Re: about Zlib

2008-07-02 Thread Amit Saxena
Hi Rajnikant, Just couple of things regarding your email format etc :- 1. It's suggested not to use official email if in the mailing list (I prefer it the same way). 2. Even if you use it, make sure that the email which you send does not have copyright statements etc as it adds to the mail s

RE: about Zlib

2008-07-02 Thread Rajnikant
Thanks for replying Jeff. But can we use Zlib for same? Rajnikant Jachak | Software Engg | Persistent Systems Limited [EMAIL PROTECTED] | Cell: +91 9822204088 | Tel: +91 (20) 3023 2479 Persistent Systems - Innovations in software product design,development and delivery - www.persistentsys.com

Re: about Zlib

2008-07-02 Thread Jeff Peng
On Wed, Jul 2, 2008 at 12:50 PM, Rajnikant <[EMAIL PROTECTED]> wrote: > I want to uncompress *.gz and *.tar on linux box. > > So is there any package which will do it for me? > Can we use Zlib to do same? Search and use a module from CPAN, that will make things fast. like: http://search.cpan.org/~