in reply to Regexp for oneliner conversion

How do I convert a Unix oneliner like this

Depends how "like" that it is:

$o = q[perl -wl -e 'print "This is text";'];; $o =~ tr['"]["'];; print $o;; perl -wl -e "print 'This is text';"

I can see many ways to make that fail, but it might be good enough.

Otherwise, you soon move into the realms of Only perl can parse Perl.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

The start of some sanity?

Replies are listed 'Best First'.
Re^2: Regexp for oneliner conversion
by cztmonk (Monk) on Aug 05, 2012 at 12:42 UTC

    Perfect! One question about the code.Why did you use

    ;;

    Typo?

      One question about the code.Why did you use ;; Typo?

      No. See Re^6: RFC: IPerl - Interactive Perl ( read-eval-print loop ) (x) and the full thread it is a part of if you really need to know; otherwise, just ignore it.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

      The start of some sanity?