<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: PERL - Escape special characters in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/perl-escape-special-characters/m-p/3695277#M103155</link>
    <description>JRF, that is NOT raw mode.&lt;BR /&gt;&lt;BR /&gt;method 1&lt;BR /&gt;&lt;BR /&gt;open my $file, "&amp;lt; $file_name" or die "$file_name: $!";&lt;BR /&gt;binmode $file;&lt;BR /&gt;&lt;BR /&gt;method 2&lt;BR /&gt;&lt;BR /&gt;open my $file, "&amp;lt;:raw", $file_name or die "$file_name: $!";&lt;BR /&gt;&lt;BR /&gt;What you probably MEANT was&lt;BR /&gt;&lt;BR /&gt;local $/; # set's input record separator to undef&lt;BR /&gt;my $content = &amp;lt;&amp;gt;; # 'while' is useless&lt;BR /&gt;&lt;BR /&gt;Being escaped is a too wide and unspecific defenition to give a solution for&lt;BR /&gt;&lt;BR /&gt;# insert a backslash in fron of specials&lt;BR /&gt;s{([.....])}{\\$1}g;&lt;BR /&gt;&lt;BR /&gt;where ..... is the range of characters that need the \&lt;BR /&gt;&lt;BR /&gt;but you could also mean to `escape' characters to html entities or octal escapes or ...&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn</description>
    <pubDate>Tue, 20 Dec 2005 14:13:35 GMT</pubDate>
    <dc:creator>H.Merijn Brand (procura</dc:creator>
    <dc:date>2005-12-20T14:13:35Z</dc:date>
    <item>
      <title>PERL - Escape special characters</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-escape-special-characters/m-p/3695274#M103152</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I have a PERL script which reads inputs from another file. But each line in the input has few special characters which needs to be escaped.&lt;BR /&gt;&lt;BR /&gt;Can anyone tell me the best way to do this?&lt;BR /&gt;&lt;BR /&gt;Is there any package available in PERL which when used automatically escapes special characters.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Anand</description>
      <pubDate>Tue, 20 Dec 2005 13:32:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-escape-special-characters/m-p/3695274#M103152</guid>
      <dc:creator>Anand_30</dc:creator>
      <dc:date>2005-12-20T13:32:28Z</dc:date>
    </item>
    <item>
      <title>Re: PERL - Escape special characters</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-escape-special-characters/m-p/3695275#M103153</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;I would read the file in raw (binary) mode:&lt;BR /&gt;&lt;BR /&gt;#/usr/bin/perl&lt;BR /&gt;my $/ = "\0";&lt;BR /&gt;while (&amp;lt;&amp;gt;) {&lt;BR /&gt;...&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Tue, 20 Dec 2005 13:46:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-escape-special-characters/m-p/3695275#M103153</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2005-12-20T13:46:17Z</dc:date>
    </item>
    <item>
      <title>Re: PERL - Escape special characters</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-escape-special-characters/m-p/3695276#M103154</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/perl&lt;BR /&gt;while (&amp;lt;&amp;gt;)&lt;BR /&gt;{&lt;BR /&gt;chomp;&lt;BR /&gt;#Put all special characters in the search pattern&lt;BR /&gt;$_ =~ s/([\$\#\@\\])/\\$1/g;&lt;BR /&gt;print "$_\n";&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Regards</description>
      <pubDate>Tue, 20 Dec 2005 13:55:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-escape-special-characters/m-p/3695276#M103154</guid>
      <dc:creator>Oviwan</dc:creator>
      <dc:date>2005-12-20T13:55:31Z</dc:date>
    </item>
    <item>
      <title>Re: PERL - Escape special characters</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-escape-special-characters/m-p/3695277#M103155</link>
      <description>JRF, that is NOT raw mode.&lt;BR /&gt;&lt;BR /&gt;method 1&lt;BR /&gt;&lt;BR /&gt;open my $file, "&amp;lt; $file_name" or die "$file_name: $!";&lt;BR /&gt;binmode $file;&lt;BR /&gt;&lt;BR /&gt;method 2&lt;BR /&gt;&lt;BR /&gt;open my $file, "&amp;lt;:raw", $file_name or die "$file_name: $!";&lt;BR /&gt;&lt;BR /&gt;What you probably MEANT was&lt;BR /&gt;&lt;BR /&gt;local $/; # set's input record separator to undef&lt;BR /&gt;my $content = &amp;lt;&amp;gt;; # 'while' is useless&lt;BR /&gt;&lt;BR /&gt;Being escaped is a too wide and unspecific defenition to give a solution for&lt;BR /&gt;&lt;BR /&gt;# insert a backslash in fron of specials&lt;BR /&gt;s{([.....])}{\\$1}g;&lt;BR /&gt;&lt;BR /&gt;where ..... is the range of characters that need the \&lt;BR /&gt;&lt;BR /&gt;but you could also mean to `escape' characters to html entities or octal escapes or ...&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn</description>
      <pubDate>Tue, 20 Dec 2005 14:13:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-escape-special-characters/m-p/3695277#M103155</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2005-12-20T14:13:35Z</dc:date>
    </item>
    <item>
      <title>Re: PERL - Escape special characters</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-escape-special-characters/m-p/3695278#M103156</link>
      <description>Hi Merijn!&lt;BR /&gt;&lt;BR /&gt;Yes, method-2 as you described where was I was (badly) trying to get toward :-)&lt;BR /&gt;&lt;BR /&gt;/* no points please */&lt;BR /&gt;&lt;BR /&gt;Regards (and thanks)!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 20 Dec 2005 14:32:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-escape-special-characters/m-p/3695278#M103156</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2005-12-20T14:32:12Z</dc:date>
    </item>
  </channel>
</rss>

