RE: Unix to dos; dos to unix...
In emacs: Esc-% C-q C-j ret C-q C-m C-q C-j ret! Where ret is either ENTER or RETURN. I just wanted to help also Joe -Original Message- From: David vd Geer Inhuur tbv IPlib [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 25, 2002 11:03 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: Unix to dos; dos to unix... Hi There, Just a small addition on the remarks : I don't know if you realy want this to automate, but vi can do it as well. Just type : :1,$s/[Ctrl + v] [Ctrl + m]//g The [Ctrl + v] makes you able to type in an escape character. Most of all the [Ctrl + m] (^M) is bothering you. :) I know, I know. It's beginners@perl and not beginners@unix. Just want to help. Good Luck !! Regs David - There is a utility out there that will convert unix-style end-of-lines (LF) to dos-style (CR/LF)... Just for giggles, I'm trying to write a perl script to do this... Here's what I've tried... while (INFILE) { $line = $_; $line=~tr/\012/\015\012/; print OUTFILE ($line\n); } The problem is that the output, when viewed with notepad, contains inappropriate line breaks... The same input file, when converted using the unix utility unix2dos, converts properly. This leads me to believe that I'm missing something obvious here I'm not asking for the answer per se, but perhaps a pointer? -- Ron Powell Senior IT Analyst Network Administrator gomembers, Inc. (Baltimore Office) [EMAIL PROTECTED] 410-494-1600 x4058 ...OLE_Obj... - -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: perlcc faq ?
Here is all of it (code, platform, error message). The code is as simple as it gets and it will not compile. Any ideas are welcome. My source: use strict; my $ans=3*12; print 3x12=$ans\n; My platform: Windows XP and Windows 2000. My Perl: v5.6.0 built for MSWin32-x86-multi-thread Binary build 618 I am in directory c:\ and invoke this: perlcc -o z.exe z.pl -- Compiling z.pl: -- Making C(z.pl.c) for z.pl! C:\Perl\bin\Perl.exe -IC:/Perl/lib -IC:/Perl/site/lib -I. -MB::Stash -c z.pl C:\Perl\bin\Perl.exe -IC:/Perl/lib -IC:/Perl/site/lib -I. -MO=C,l2000,-umain,-uattributes,-uDB,-unone,-uWin32,-ustrict z.pl The system cannot find the file specified. ERROR: In generating code for z.pl! -Original Message- From: zentara [mailto:[EMAIL PROTECTED]] Sent: Monday, April 15, 2002 5:48 PM To: [EMAIL PROTECTED] Subject: Re: perlcc faq ? On Mon, 15 Apr 2002 09:47:23 -0400, [EMAIL PROTECTED] (Joe Collins) wrote: Hi, I tried the perlcc process this w/e and I am sure I am using it correctly, i.e. proper parms, good perl program etc but I keep getting a vague error, i.e. the system cannot find the specified file - and it gives NO hint of which file it wants, i.e. .pm, .dll etc? Is there an FAQ for perlcc or cannot someone post some pointers on how to use and pitfalls? What is the exact error message you are getting? There was a bug in one of the 5.6 series of perl that you need to patch to get perlcc to work. I'm not sure if that's your error though. Post the exact error message. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
giving up on perlcc, now trying perl -MO=c z.pl, still hasproble ms
Perlcc.bat seems to difficult at this stage and thus I tried simplifying it. My platform: Windows 2000 or XP My Perl: v5.6.0 built for MSWin32-x86-multi-thread Binary build 618 z.pl: use strict; my $ans=3*12; print 3x12=$ans\n; What I tried: perl -MO=c z.pl The results: Undefined subroutine B::c::compile called at C:/perl/lib/o.pm line 11 BEGIN failed--compilation aborted. Any ideas? I think I am getting closer Joe -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
perlcc faq ?
Hi, I tried the perlcc process this w/e and I am sure I am using it correctly, i.e. proper parms, good perl program etc but I keep getting a vague error, i.e. the system cannot find the specified file - and it gives NO hint of which file it wants, i.e. .pm, .dll etc? Is there an FAQ for perlcc or cannot someone post some pointers on how to use and pitfalls? Thanks, Joe -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: perlcc the system cannot find the file specified. ??
I did ...I went to \perl\bin and found perlcc.bat - I then copied my .pl program (lamore.pl) there and typed: perlcc -o z.exe lamore.pl It started running and invoked Perl twice and then coughed up that message. I browsed perlcc.bat and did not find the message in there so it must be coming from perl.exe but no clue on which file perl.exe wants. I also tried the same stuff in c:\ and received the same messages. Any ideas? Joe -Original Message- From: Timothy Johnson [mailto:[EMAIL PROTECTED]] Sent: Sunday, April 14, 2002 6:52 PM To: 'Joe Collins '; [EMAIL PROTECTED] Subject: RE: perlcc the system cannot find the file specified. ?? Is perlcc in your path? It sounds to me like your OS can't find perlcc. Try using the full path to perlcc. -Original Message- From: Joe Collins To: [EMAIL PROTECTED] Sent: 4/14/02 12:39 PM Subject: Q: perlcc the system cannot find the file specified. ?? I run perlcc and get the error the system cannot find the file specified. My options are -o to create the executable. Any ideas what it wants? I confirmed the .pl I am compiling is clearly visible. TIA, Joe -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This email may contain confidential and privileged material for the sole use of the intended recipient. If you are not the intended recipient, please contact the sender and delete all copies. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
perlcc - newbie - cannot compile successfully - sample session
Do I need something else, i.e. path settings or whatever? My source: use strict; my $ans=3*12; print 3x12=$ans\n; My platform: Windows XP I am in directory c:\ and invoke as shown. perlcc -o z.exe z.pl -- Compiling z.pl: -- Making C(z.pl.c) for z.pl! C:\Perl\bin\Perl.exe -IC:/Perl/lib -IC:/Perl/site/lib -I. -MB::Stash -c z.pl C:\Perl\bin\Perl.exe -IC:/Perl/lib -IC:/Perl/site/lib -I. -MO=C,l2000,-umain,-uattributes,-uDB,-unone,-uWin32,-ustrict z.pl The system cannot find the file specified. ERROR: In generating code for z.pl! Help! Joe -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
perl script to .exe?
Does anyone know of an inexpensive way to turn a perl script (under windows/msdos) to an .exe file? I am aware of perl2exe but I think there may be better and less expensive methods. Thanks, Joe -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Learing perl
I learned Perl using teach Yourself Perl in 21 Days by David Till. Then I grabbed the Perl Cookbook. That was enough for me to feel comfortable in Perl and write some complex (for me) programs using anonymous array pointers and so on. Hope that helps. Joe -Original Message- From: Timothy Johnson [mailto:[EMAIL PROTECTED]] Sent: Monday, March 25, 2002 10:33 AM To: 'Rune Hegrenes '; [EMAIL PROTECTED] Subject: RE: Learing perl As for the PerlBuilder part, I've been using it for a while, and I consider it a worthwhile investment, but if you're not using Perl on a regular basis yet, it might be a bit expensive. The mouse-over bracket matching is especially useful for beginners. As for resources, try searching for Perl Tutorial on Google. There are a few beginning tutorials out there for the uninitiate. If you are stumped on why something doesn't work, here is a good place to ask as well. -Original Message- From: Rune Hegrenes To: [EMAIL PROTECTED] Sent: 3/25/02 6:41 AM Subject: Learing perl Hi I'm trying to learn perl. Are there any good resources on the net where I can begin?? What software do I need? I have downloaded an evaluation version of PerlBuilder: Is this any good? Thanks for any help... Rune This email may contain confidential and privileged material for the sole use of the intended recipient. If you are not the intended recipient, please contact the sender and delete all copies. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
FW: Perldoc question
If new to unix and you want to find perldoc (or any module), try this: find . -name perldoc* -print That will locate perldoc and show you the path to it. You could also try: whence perldoc That may also work (works for me under ksh) Hope that helps, Joe -Original Message- From: Tyler Longren [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 12, 2002 2:24 PM To: Joe Echavarria; Hanson, Robert; [EMAIL PROTECTED] Subject: Re: Perldoc question type this at your command line: echo $PATH That should display a few folders (/usr/local/bin, /usr/bin, etc...). your perldoc executable should be located in a folder listed in your $PATH. Good luck, Tyler - Original Message - From: Joe Echavarria [EMAIL PROTECTED] To: Hanson, Robert [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, March 12, 2002 1:15 PM Subject: RE: Perldoc question I really don ' t understand what you mean. I am new to Unix and Perl. Please help me out here. What i should to ?, read or what ? Thanks. Joe. --- Hanson, Robert [EMAIL PROTECTED] wrote: perldoc isn't in your path most likely. Check your path environment variable (echo $PATH), and make sure that perldoc is in one of those directories. If I had to guess you probably have a symlink to the perl executable in your path, but not the actual bin/ directory of perl. Rob -Original Message- From: Joe Echavarria [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 12, 2002 1:48 PM To: [EMAIL PROTECTED] Subject: Perldoc question hi there, On my unix box when i try to get perl help from the command line using perldoc print or perlfunc i get these errores. perlfunc: not found perldoc: not found How can i fix this problem ? Thanks. Joe. __ Do You Yahoo!? Try FREE Yahoo! Mail - the world's greatest free email! http://mail.yahoo.com/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How do I read a web page from within perl?
For example, suppose I want to capture www.cnn.com into an array and process the text. How does one do this? Many thanks, Joe -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: comparing strings
Worth reading, including the end where Jonathan expands on his earlier post. -Original Message- From: Jonathan E. Paton [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 29, 2002 1:32 PM To: Collins, Joe (EDSIBDR) Subject: RE: Comparing strings | Don't know if this helps, but the following code | | $one = ExamPle; | $two = example; | | if ($one=~/$two/i) { | print true ; | } | | | This is a bad idea for anything other than throwaway | scripts... it requires building a full regex everytime | (from $two). You *MUST* use quotemeta() on $two to make | it safe, other any regex characters will apply - which is | VERY UNSAFE. | | Perl might be fast, but best not making it work harder | than is needed. | | Unsafe, why? | | | What if $two contained: | | .*)*)*)*)*a$ | | that has exponential runtime :( | | BUT, what if $two contained: | | ?{system('rm -rf /')} | | that'd REALLY wreak your day - as you reach for the most | recent backup tapes... | | Jonathan Paton | Hi Jonathan, Very interesting reply and it opened my eyes(!)scary stuff. Kindly explain a bit before I write some PERL/CGI code and have a user fill in a field that I do a regexp on and wipe out my web hosting site!! You should be very, very scared indeed. If you are doing CGI you do need to take a lot more care. Taint mode is helpful when you wish to strengthen your code. I'd read the relevent security chapters a few times over, it is quite enlightening. perldoc perlsec Also, do get your code checked out by peers... it's amazing what others can spot that you didn't know. If you don't have anyone then email it to the list (if small or complex) or myself (if big). I quite enjoy pointing out subtle problems/issues when reviewing code ;) I write because I tried what you did (changing the rm etc!!) and it doesn't work, i.e. I tried this for $two on perl v5.6.0 on my PC platform and it does not create junk.txt as I think it should. I also do not find the ? command in my perl books. perldoc perlre $two=?{system 'echo hello world junk.txt'} Okay, I've just tested this one. I haven't been telling the whole truth it seems! This *WILL ONLY* be executed in a use re 'eval' scope - which gives you some security from it. The other problem kind I showed still causes it's grief without this. Just remember that someday, someone *could* put that statement in. You need to place () around the ?{} block, by the way. (I am somewhat of a newbie, using perl every day since mid September 2001 to process and compare large text files and fields therein). I was a paid summer student starting just two months earlier, for a period of 12 weeks... however, I had/have plenty of time to dig into the interesting things. Jonathan Paton __ 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 commands, e-mail: [EMAIL PROTECTED]
A becomes 1, B becomes 2, etc
Hi, How can I convert the scalar 'A' (or 'a') to 1, 'B' to 2 and so on? Related: how do I get the true internal value for A, i.e. ascii value? Thanks! Joe -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
how to tell if hash value is null vs missing
Consider this perl stub: $value=$myhash{$mykey}; If the value in the hash at $mykey is , then $value becomes and if $mykey is not a valid key, then $value still becomes How do I differentiate between the two? Please email me (email address below) if you know the answer. Thanks, Joe [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]