in reply to String manipulation

That ^@ thingy looks a lot like some binary data with non-printable characters.

As a start you could find out which char it is:

# assuming the string is in $data: print ord(substr($data, 0, 1)), "\n";

Then when you know exactly which character it is, you can remove it with a regular expression.

The not-so-safe method would be to remove any leading non-space characters:

$data =~ s/^[^ ]+//;

Replies are listed 'Best First'.
Re^2: String manipulation
by ikegami (Patriarch) on Aug 07, 2007 at 20:41 UTC
    ^@ is a common representation of char 0 (NUL in ASCII).
Re^2: String manipulation
by bajangerry (Sexton) on Aug 07, 2007 at 20:59 UTC
    I added your code so that it would print before the real data and this is the result:
    73
    08/07 04:48P 00:00:04 102 9 4249785
    73
    08/07 04:48P 00:00:02 T001 001
    As you can see I get a "73" printing before the line of data... strange!
    Actually, I stopped and restarted the script and guess what... the output has changed from "73" to "32"!
    I think I will try the "not so safe" method and see what happens. By the way, why do you say this is "not so safe"? because of possibly deleting actual data or is there another reason?
      I want to thank you guys for all your help, things look as if they are working fine now, you guys were great!
      I wrote it's "not so safe" because it deletes data if the real data does not begin with a blank. If the data is always formed as you say it is, the method is safe.