Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6994947
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:57:28+00:00 2026-05-27T19:57:28+00:00

I have a Perl script which runs fine under Perl 5.005 on HPUX 11i

  • 0

I have a Perl script which runs fine under Perl 5.005 on HPUX 11i v3 and that causes a small problem under Perl 5.10 on my Ubuntu 11.04 box.

It boils down to a line like:

open (CMD, "do something | grep -E 'sometext$' |");

(it’s actually capturing ps -ef output to see if a process is running but I don’t think that’s important (a)).

Now this runs fine on the HPUX environment but, when I try it out under Ubuntu, I get:

sh: Syntax error: Unterminated quoted string

By inserting copious debug statements, I tracked it down to that offending line then started removing characters one-by-one until it stopped complaining. Luckily, $ was the first one I tried and it stopped giving me the error, so I then changed the line to:

open (CMD, "do something | grep -E 'sometext\$' |");

and it worked fine (under Linux anyway – I haven’t tested that on HPUX since I don’t have access to that machine today – if it does work, I’ll just use that approach but I’d still like to know why it’s a problem).

So it seems obvious that the $ is “swallowing” the closing single quote under my Linux environment but not apparently on the HPUX one.

My question is simply, why? Surely there weren’t any massive changes between 5.005 and 5.10. Or is there some sort of configuration item I’m missing?


(a) But, if you know a better way to do this without external CPAN modules (ie, with just the baseline Perl 5.005 installation), I’d be happy to know about it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T19:57:29+00:00Added an answer on May 27, 2026 at 7:57 pm

    $' is a special variable (see perldoc perlvar). 5.005 was many versions ago, so it’s possible that something has changed in the regexp engine to make this variable different (although it appears to be in 5.005 also)

    As for the better way, you could at least only run the ‘ps -ef’ in a pipeline and do the ‘grep’ in perl.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple Perl script which runs as a Linux daemon using an
I have written a Perl script that runs as a daily crontab job that
I'm trying to update some existing code that normally runs a Perl script which
I have a perl script (which syncs delicious to wp) which: runs via the
The situation I am in is that I have written a perl script which
I have a perl script which works fine, when run manually, however it's not
My problem is: I have a perl script which uses lot of memory (expected
I have a Perl script which maps two drives, and then proceeds to copy
I have a Perl script which nests foreach loops as seen below. It takes
I have a Perl script which will allow for a file to be uploaded

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.