Re: The old \015 problem

2004-10-08 Thread David D Miller




Thanks to everyone for suggestions.

Yes, DOS ftp stinks. Maybe the GUI version is better, I didn't try.

Instead, I used a translate command to eliminate \015 throughout the file.

dave.

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: The old \015 problem

2004-10-07 Thread David D Miller




Carter:

Where do I find this wonderful little tool?  I looked for it on DOS and
Unix without any luck.  Not part of the perl delivery I guess.

dave.




A really easy way is to use "dos2unix".  It'll take care of the CRs.

Carter.



> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On
> Behalf Of David D Miller
> Sent: Thursday, October 07, 2004 2:35 PM
> To: [EMAIL PROTECTED]
> Subject: The old \015 problem
>
>
>
>
>
>
> Folks
>
> I just copied (using ftp in binary mode) my perl scripts from
> DOS to Unix and got caught on the carriage return problem:
> When I try to execute the DOS scipt in Unix, I get the following
>
> [mdscom]/usr/people/dmiller/WWW/cgi> perl wtdl.pl -w
> Illegal character \015 (carriage return) at wtdl.pl line 5.
> (Maybe you didn't strip carriage returns after a network transfer?)
>
> Good message.  Right on target.  The question is, how do I
> remove those pesky CRs?
>
> dave.
>
> ___
> Perl-Win32-Users mailing list
> [EMAIL PROTECTED]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>



___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: The old \015 problem

2004-10-07 Thread David D Miller




Dennis

Tried that.

I did a ftp> put on DOS side.  Got a nastygram and ftp hung.  That's why I
did binary mode.

dave.



The easiest way is don't use binary mode. The ftp
software is smart enough to handle it.

Good  Luck!
Dennis


On Thu, 7 Oct 2004, David D Miller wrote:

> Date: Thu, 7 Oct 2004 14:34:48 -0700
> From: David D Miller <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: The old \015 problem
>
>
>
>
>
> Folks
>
> I just copied (using ftp in binary mode) my perl scripts from DOS to Unix
> and got caught on the carriage return problem:  When I try to execute the
> DOS scipt in Unix, I get the following
>
> [mdscom]/usr/people/dmiller/WWW/cgi> perl wtdl.pl -w
> Illegal character \015 (carriage return) at wtdl.pl line 5.
> (Maybe you didn't strip carriage returns after a network transfer?)
>
> Good message.  Right on target.  The question is, how do I remove those
> pesky CRs?
>
> dave.
>
> ___
> Perl-Win32-Users mailing list
> [EMAIL PROTECTED]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


The old \015 problem

2004-10-07 Thread David D Miller




Folks

I just copied (using ftp in binary mode) my perl scripts from DOS to Unix
and got caught on the carriage return problem:  When I try to execute the
DOS scipt in Unix, I get the following

[mdscom]/usr/people/dmiller/WWW/cgi> perl wtdl.pl -w
Illegal character \015 (carriage return) at wtdl.pl line 5.
(Maybe you didn't strip carriage returns after a network transfer?)

Good message.  Right on target.  The question is, how do I remove those
pesky CRs?

dave.

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: scanf equivalent?

2004-09-07 Thread David D Miller




Exactly what I need.  Thanks!

dave.



At 21:47 2004-09-07, David D Miller wrote:
>My problem is to read a hex value from a file and process it in binary.
>For instance, I read a file containing data of the form 0x0b4f.  Then I
>need to mask/shift etc that data before displaying it.

You probably want hex().

perl -e "print hex('0x0b4f')"
perl -e "printf('%x', hex('0x0b4f'))"
perldoc -f hex


/J

 --  --- -- --  --  - - --  -
Johan LindströmSourcerer @ Boss Casinos   johanl AT DarSerMan.com

Latest bookmark: "TCP Connection Passing"
http://tcpcp.sourceforge.net/
dmoz: /Computers/Programming/Languages/JavaScript/ 12

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs




___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


scanf equivalent?

2004-09-07 Thread David D Miller




Experts:

How do I do the equivalent of scanf in perl?

My problem is to read a hex value from a file and process it in binary.
For instance, I read a file containing data of the form 0x0b4f.  Then I
need to mask/shift etc that data before displaying it.

dave.

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs