Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^3: How to trim a line from leading and trailing blanks without using regex or non-standard modules

by LanX (Saint)
on Aug 15, 2020 at 01:04 UTC ( [id://11120758]=note: print w/replies, xml ) Need Help??


in reply to Re^2: How to trim a line from leading and trailing blanks without using regex or non-standard modules
in thread How to trim a line from leading and trailing blanks without using regex or non-standard modules

>  trim(/\s/.$line)

I doubt this is valid syntax.

you probably mean

 trim( qr/\s/, $line)

see Re^3: How to trim a line from leading and trailing blanks without using regex or non-standard modules for a slightly better implementation

> this is impossible in Python

passing regex inside a string is fine in Perl, why not in Python?

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://11120758]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2024-03-28 22:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found