Perl: while with no conditional

$ perl -MO=Deparse -e ‘while () { }’ while (1) { (); } -e syntax OK It seems that while () {} and while (1) {} are equivalent. Also note that empty parens* are inserted in the empty block. Another example of pre-defined compiler behaviour: $ perl -MO=Deparse -e ‘while (<>) { }’ while (defined($_ … Read more

return in for loop or outside loop

Now someone told me that this is not very good programming because I use the return statement inside a loop and this would cause garbage collection to malfunction. That’s incorrect, and suggests you should treat other advice from that person with a degree of skepticism. The mantra of “only have one return statement” (or more … Read more

ORA-06502: PL/SQL: numeric or value error: character string buffer too small

PL/SQL: numeric or value error: character string buffer too small is due to the fact that you declare a string to be of a fixed length (say 20), and at some point in your code you assign it a value whose length exceeds what you declared. for example: myString VARCHAR2(20); myString :=’abcdefghijklmnopqrstuvwxyz’; –length 26 will … Read more