ctaustin has asked for the wisdom of the Perl Monks concerning the following question:
print "Enter User:\n"; $luser=<STDIN>; print "Enter Pass:\n"; $pass=<STDIN>; $luser=pack("A*",$luser); $pass=pack("A*",$pass); open (PFILE,">pass.bin") or die ("unable to open file $!\n"); binmode PFILE; print PFILE "$luser|$pass"; close PFIFLE;
Of course, reading doesn't work since I am not getting the correct data in the file.open (PFILE,"pass.bin") or die ("unable to open file $!\n"); binmode PFILE; while ($line=<PFILE>){ $line=unpack("A*",$line); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: ascii to binary
by GrandFather (Saint) on Jul 23, 2005 at 00:01 UTC | |
by CountZero (Bishop) on Jul 23, 2005 at 21:26 UTC | |
|
Re: ascii to binary
by davidrw (Prior) on Jul 23, 2005 at 00:03 UTC | |
|
Re: ascii to binary
by ikegami (Patriarch) on Jul 23, 2005 at 00:04 UTC | |
|
Re: ascii to binary
by ctaustin (Sexton) on Jul 23, 2005 at 01:25 UTC |