Re: Perl version 5.8 and 5.10

2023-10-08 Thread Levi Elias Nystad-Johansen via beginners
Hi, What is your use case, maybe it can be solved by adding "use v5.8;" or "use v5.10;" at the top? It is rarely needed to install such an old version of perl, unless it's for testing compatibility, but then we should aim higher than v5.8. v5.16 is the oldest version supported by toolchain,

Re: Modules

2023-10-24 Thread Levi Elias Nystad-Johansen via beginners
I use modules for complex things that I might get wrong. To re-use other people's code is often better than to re-invent their solutions. https://metacpan.org/pod/WWW::Mechanize::Examples has some good examples of useful scripts that are short and simple. Imagine how hard it would be to write

Re: My progress in Perl

2023-08-07 Thread Levi Elias Nystad-Johansen via beginners
Hi, Learning Perl is a great book, but anyone looking for an alternative should check out Minimal Perl by Tim Maher. I've found this book to be a little clearer and with more practical examples. I've used Perl on windows for years, as it is far more powerful and portable than Batch and

Re: telephone book

2023-06-22 Thread Levi Elias Nystad-Johansen via beginners
Hi, Not sure exactely what you mean, but here is a one-liner that'll produce 100 phone numbers in sequence, from a random starting point: perl -E '$start = 10_000_000 + int 89_999_899*rand; say for $start..$start+100' Hope it helps :) -L --- Original Message --- On Thursday, June

Re: regex

2024-01-22 Thread Levi Elias Nystad-Johansen via beginners
I agree that this is confusing, and I think many resources describing regex in unhelpful ways is partly to blame. descriptions like "pattern that matches against a string" and similar. this implies that a regex has to match the string, but this is not the case. a regex does not have to match the

Re: lines of code for code a website

2024-05-03 Thread Levi Elias Nystad-Johansen via beginners
This depends on the complexity and size of the website. A very simple website needs 0 lines of C, Java, PHP, or Perl - since it can be made with only HTML. Big and complex websites might need 100.000s lines of code, in multiple languages. -L On Friday, May 3rd, 2024 at 8:27 AM, William Torrez

Re: regex matching statements

2024-06-19 Thread Levi Elias Nystad-Johansen via beginners
Hi, Yes, they are the same. I like to use $_ only when the data comes in $_ naturally. Like in a for loop: for (qw< abc >) { if ( !/\w+\d+/ ) { print "not matched"; } } Otherwise, I have to write $_, then I prefer to name the variable something descriptive instead. Makes the code