Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^5: How to replace spaces with different chars?

by kcott (Archbishop)
on Jul 08, 2022 at 17:42 UTC ( #11145361=note: print w/replies, xml ) Need Help??


in reply to Re^4: How to replace spaces with different chars?
in thread How to replace spaces with different chars?

"Sorry, I have to disagree."

Do you? What precisely are you disagreeing with? Please provide a full, verbatim quote of anything I wrote that you disagree with.

The facts:

  • The OP asked how system could be used.
  • I provided an example in answer to this.
  • I followed this up with a further example contrasting system(...) (no capture of command output), with `...` (capture of command output possible), in accordance with the system documentation.

You seem to have concocted the idea that I recommended shelling out and, on the basis of that fictitious notion, decided that the appropriate action was to educate me.

My reference to TMTOWTDI, including a smiley, was simply a nod to the fact that other (better) ways were possible. I've no idea where your modified definition originated; I suggest you follow the link and read:

"This doesn’t mean that more ways are always better or that all possible paths are equally desirable ..."

There's certainly no reference to your:

"TMTOWTDI only covers this, if there is a good reason."

— Ken

Replies are listed 'Best First'.
Re^6: How to replace spaces with different chars?
by LanX (Sage) on Jul 10, 2022 at 17:43 UTC
    Ken, I'm not sure where this misunderstanding comes from.

    First of all I already said that replacing whitespace with a character-class for globbing is the best of all solutions.

    Regarding TMTOWTDI from perlglossary

    > TMTOWTDI There’s More Than One Way To Do It, the Perl Motto. The notion that there can be more than one valid path to solving a programming problem in context. (This doesn’t mean that more ways are always better or that all possible paths are equally desirable—just that there need not be One True Way.)

    My "disagreement" is, that using the build-in glob is "the one true way".

    There are exceptions, where running an external command can be desirable. For instance is the regex engine of unix-grep often far more performant, IIRC.

    And I'm not educating you, I'm providing information for all potential future readers.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11145361]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2022-10-04 22:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred way to holiday/vacation is:











    Results (19 votes). Check out past polls.

    Notices?