Spooky has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks, ..two questions: 1) ..in trying to print a string, I'm able to print the string itself but the end contains special characters - e.g., "Voltage_level" is what I want to print but I'm getting "Voltage_Level^A" (the last eight bits are 00000001 which is a hex 01 and control SOH). How can I avoid printing special characters? 2) How can I delete Node IDs under my userid (spooky). ..........Thanks!
  • Comment on excluding special characters when trying to print

Replies are listed 'Best First'.
Re: excluding special characters when trying to print
by Corion (Patriarch) on Jan 09, 2009 at 13:46 UTC

    The best approach to removing unwanted stuff in your program output is not to have it in the data in the first place. Depending on how you acquire the input data, you might want to sanitize it, by only keeping the printable stuff:

    s/[\x00-\x1f]/_/g; # replace all unprintables with _

    ... or you might want to find out why you're getting unprintable characters in your input data.

    As to deleting nodes, this is not possible here. Also see (tye)Re: why a nodelet can be kept against author wish?.

      I would recommend this instead:
      s/[[:^print:]]/_/g; # replace all unprintables with _
      ..thanks Corion - I'll give that a try.
Re: excluding special characters when trying to print
by swampyankee (Parson) on Jan 09, 2009 at 13:59 UTC

    About the only way you can delete nodes under your ID is to ask for them to be reaped. My advice is to never write anything you're not willing to let stand forever ;-)


    Information about American English usage here and here. Floating point issues? Please read this before posting. — emc